diff options
author | Geert Uytterhoeven <geert+renesas@linux-m68k.org> | 2014-02-21 11:29:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-22 22:27:03 -0500 |
commit | ba824d4971691a7f1f66429e378a08a95fbb5b79 (patch) | |
tree | 24c54aa3d39da05a294e9a54044683d84631f771 /drivers/spi/spi-rspi.c | |
parent | ab98fcba962a57cee9fdb97aff2b25248c93cea5 (diff) |
spi: rspi: Fix loopback mode for Dual/Quad SPI Transfers
While normal Dual and Quad SPI Transfers are unidirectional, we must do
a bidirectional transfer if loopback mode is enabled, else rx_buf is not
filled.
With spidev it seemed to work, as spidev uses the same buffer for
tranmission and reception.
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-rspi.c')
-rw-r--r-- | drivers/spi/spi-rspi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 4a1f978c3381..92bec7e91046 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -859,7 +859,9 @@ static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi, | |||
859 | { | 859 | { |
860 | struct rspi_data *rspi = spi_master_get_devdata(master); | 860 | struct rspi_data *rspi = spi_master_get_devdata(master); |
861 | 861 | ||
862 | if (xfer->tx_buf && xfer->tx_nbits > SPI_NBITS_SINGLE) { | 862 | if (spi->mode & SPI_LOOP) { |
863 | return qspi_transfer_out_in(rspi, xfer); | ||
864 | } else if (xfer->tx_buf && xfer->tx_nbits > SPI_NBITS_SINGLE) { | ||
863 | /* Quad or Dual SPI Write */ | 865 | /* Quad or Dual SPI Write */ |
864 | return qspi_transfer_out(rspi, xfer); | 866 | return qspi_transfer_out(rspi, xfer); |
865 | } else if (xfer->rx_buf && xfer->rx_nbits > SPI_NBITS_SINGLE) { | 867 | } else if (xfer->rx_buf && xfer->rx_nbits > SPI_NBITS_SINGLE) { |