summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-ti-qspi.c
diff options
context:
space:
mode:
authorSourav Poddar <sourav.poddar@ti.com>2013-08-23 15:12:16 +0530
committerMark Brown <broonie@linaro.org>2013-08-23 12:00:32 +0100
commit70e2e9761a580cc9ef84be69dac2279dd6c2c72f (patch)
treeaf6ca218d41be245a1c7263a648764ecbfe1eb22 /drivers/spi/spi-ti-qspi.c
parent21e34a3306e7f0399cc0e10c24cb0e7790dfbcac (diff)
spi/qspi: Add dual/quad spi read support
Support for multiple lines in SPI framework has been picked[1]. [1]: http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420 Hence, adapting ti qspi driver to support multiple data lines for read. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-ti-qspi.c')
-rw-r--r--drivers/spi/spi-ti-qspi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 09e241551fcc..c07e04170b91 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -267,7 +267,18 @@ static int qspi_read_msg(struct ti_qspi *qspi, struct spi_transfer *t)
u8 *rxbuf;
rxbuf = t->rx_buf;
- cmd = qspi->cmd | QSPI_RD_SNGL;
+ cmd = qspi->cmd;
+ switch (t->rx_nbits) {
+ case SPI_NBITS_DUAL:
+ cmd |= QSPI_RD_DUAL;
+ break;
+ case SPI_NBITS_QUAD:
+ cmd |= QSPI_RD_QUAD;
+ break;
+ default:
+ cmd |= QSPI_RD_SNGL;
+ break;
+ }
count = t->len;
wlen = t->bits_per_word;