diff mbox

spi: omap2-mcspi: Fix mcspi FIFO usage

Message ID 1390211044-9791-1-git-send-email-sourav.poddar@ti.com (mailing list archive)
State New, archived
Delegated to: Mark Brown
Headers show

Commit Message

Poddar, Sourav Jan. 20, 2014, 9:44 a.m. UTC
The following commit add Fifo support for omap mcspi.
commit d33f473dcd8e69321f001ba330d648f475b504c9
Author: Illia Smyrnov <illia.smyrnov@ti.com>
Date:   Mon Jun 17 16:31:06 2013 +0300

    spi: omap2-mcspi: Add FIFO buffer support

Currently, enabling of FIFO is done based on rx_buf or tx_buf checks
and only one of the RX or TX fifo is enabled. There can be transfers
in which both RX/TX fifo is desired. Hence, fixing code for the
same to allow setting both TX/RX fifo when needed.

Application:
While doing a loopback testing on beaglebone white(DMA
with FIFO enabled), where both RX and TX buf buffers are passed,
./spidev_test hangs.
The $subject patch fixes that hang and data can be loopbacked.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
---
 drivers/spi/spi-omap2-mcspi.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index ed4af47..86402a7 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -299,7 +299,9 @@  static void omap2_mcspi_set_fifo(const struct spi_device *spi,
 		if (t->rx_buf != NULL) {
 			chconf |= OMAP2_MCSPI_CHCONF_FFER;
 			xferlevel |= (fifo_depth - 1) << 8;
-		} else {
+		}
+
+		if (t->tx_buf != NULL) {
 			chconf |= OMAP2_MCSPI_CHCONF_FFET;
 			xferlevel |= fifo_depth - 1;
 		}