spi: dual and quad support(add single macro)
Subsystems (2)
PATCH 1/2 spi: dual and quad support(add single macro)
fix using default value to specify single mode in patch:
commit id:f477b7fb13df2b843997559ff34e87d054ba6538
Using mode & ~(DUAL | QUAD) to specify SINGLE mode, instead of using default value in mode. Which means if select neither DUAL nor QUAD, SINGLE will be in use.
--- drivers/spi/spi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/spi/spi.c +8 -1
@@ -872,10 +872,15 @@ static void of_register_spi_devices(struct spi_master *master)/* Device DUAL/QUAD mode */ prop =of_get_property (nc,"spi-tmax-nbits" , &len);if (!prop || len <sizeof (*prop)) { -/* set tx mode in SINGLE as default */ +/* +* set tx mode in SINGLE as default +* if select neither DUAL nor QUAD, regarded as single. +*/ + spi->mode &= ~(SPI_TX_DUAL |SPI_TX_QUAD ); }else {switch (be32_to_cpup (prop)) {case SPI_NBITS_SINGLE : + spi->mode &= ~(SPI_TX_DUAL |SPI_TX_QUAD );break ;case SPI_NBITS_DUAL : spi->mode |=SPI_TX_DUAL ;
@@ -893,9 +898,11 @@ static void of_register_spi_devices(struct spi_master *master) prop =of_get_property (nc,"spi-rmax-nbits" , &len);if (!prop || len <sizeof (*prop)) {/* set rx mode in SINGLE as default */ + spi->mode &= ~(SPI_RX_DUAL |SPI_RX_QUAD ); }else {switch (be32_to_cpup (prop)) {case SPI_NBITS_SINGLE : + spi->mode &= ~(SPI_RX_DUAL |SPI_RX_QUAD );break ;case SPI_NBITS_DUAL : spi->mode |=SPI_RX_DUAL ;
Signature · 1 line
1.7.9.5
PATCH 2/2 Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538
Delete a "return" when commit the patch to a new kernel version
by mistake. So recover it.
--- drivers/spi/spi.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi.c +1 -0
@@ -1466,6 +1466,7 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)return -EINVAL ;if (xfer->speed_hz && master->max_speed_hz && xfer->speed_hz > master->max_speed_hz) +return -EINVAL ;if (xfer->tx_buf && !xfer->tx_nbits) xfer->tx_nbits =SPI_NBITS_SINGLE ;
Signature · 1 line
1.7.9.5
Re: [PATCH 2/2] Miss return in patch: commit id:f477b7fb13df2b843997559ff34e87d054ba6538
Quoted 2 lines · wangyuhang
Delete a "return" when commit the patch to a new kernel version
by mistake. So recover it.
Applied, thanks.
Your commit subject should be in the form "spi: quad: Human readable text" - I fixed this one up to read:
spi: quad: Fix missing return