Commit 4d03fa2c authored by Imre Deak's avatar Imre Deak Committed by Juha Yrjola

ARM: OMAP: omap_uwire: wait for tx complete before starting the next one

The TDR register shouldn't be written when the CSRB flag is set. The fix
solves the problem where one SPI transfer includes multiple 8 or 16 bit
tx elements and the current transfer can be corrupted by accessing the
TDR too early.
Signed-off-by: default avatarImre Deak <imre.deak@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@solidboot.com>
parent 0976dc5e
...@@ -240,12 +240,13 @@ static int uwire_txrx(struct spi_device *spi, struct spi_transfer *t) ...@@ -240,12 +240,13 @@ static int uwire_txrx(struct spi_device *spi, struct spi_transfer *t)
pr_debug("%s: write-%d =%04x\n", pr_debug("%s: write-%d =%04x\n",
spi->dev.bus_id, bits, val); spi->dev.bus_id, bits, val);
#endif #endif
if (wait_uwire_csr_flag(CSRB, 0, 0))
goto eio;
uwire_write_reg(UWIRE_TDR, val); uwire_write_reg(UWIRE_TDR, val);
/* start write */ /* start write */
val = START | w | (bits << 5); val = START | w | (bits << 5);
if (wait_uwire_csr_flag(CSRB, 0, 0))
goto eio;
uwire_write_reg(UWIRE_CSR, val); uwire_write_reg(UWIRE_CSR, val);
len -= bytes; len -= bytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment