From: Sourav Poddar Date: Fri, 23 Aug 2013 09:42:16 +0000 (+0530) Subject: spi/qspi: Add dual/quad spi read support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=70e2e9761a580cc9ef84be69dac2279dd6c2c72f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 --- 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;