From 70e2e9761a580cc9ef84be69dac2279dd6c2c72f Mon Sep 17 00:00:00 2001 From: Sourav Poddar Date: Fri, 23 Aug 2013 15:12:16 +0530 Subject: [PATCH] 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 Signed-off-by: Mark Brown --- drivers/spi/spi-ti-qspi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.20.1