diff mbox

[5/8] spi: sirf: add fifo reset/start for cmd transfer

Message ID 1409648557-5470-1-git-send-email-Barry.Song@csr.com (mailing list archive)
State Accepted
Commit 810a58b0256b24f194dda5ca1e705204ca703f7b
Headers show

Commit Message

Barry Song Sept. 2, 2014, 9:02 a.m. UTC
From: Qipan Li <Qipan.Li@csr.com>

for command mode spi transfer, HW spec requires to do fifo reset work to
clear FIFO status.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/spi/spi-sirf.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Sept. 4, 2014, 10:37 p.m. UTC | #1
On Tue, Sep 02, 2014 at 05:02:34PM +0800, Barry Song wrote:
> From: Qipan Li <Qipan.Li@csr.com>
> 
> for command mode spi transfer, HW spec requires to do fifo reset work to
> clear FIFO status.

Applied, thanks.  This seems like a bug fix so sohuld have been towards
the start of the series.
diff mbox

Patch

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 93376a2..7499076 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -311,6 +311,8 @@  static void spi_sirfsoc_cmd_transfer(struct spi_device *spi,
 	u32 cmd;
 
 	sspi = spi_master_get_devdata(spi->master);
+	writel(SIRFSOC_SPI_FIFO_RESET, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
+	writel(SIRFSOC_SPI_FIFO_START, sspi->base + SIRFSOC_SPI_TXFIFO_OP);
 	memcpy(&cmd, sspi->tx, t->len);
 	if (sspi->word_width == 1 && !(spi->mode & SPI_LSB_FIRST))
 		cmd = cpu_to_be32(cmd) >>