]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
bfin: discard invalid data and clear RXS in bf5xx spi driver
authorScott Jiang <scott.jiang.linux@gmail.com>
Wed, 7 Dec 2011 19:53:30 +0000 (14:53 -0500)
committerSonic Zhang <sonic.zhang@analog.com>
Mon, 13 May 2013 08:26:27 +0000 (16:26 +0800)
There may be dirty data in RDBR, so we should discard invalid data.
This operation also clears RXS bit in STAT register.

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
drivers/spi/bfin_spi.c

index 0fa131b21df7232d0786e2e52130bea77f0fda0f..a9a4d92c3e719b0a1f215393ac7fc22de6cae8cf 100644 (file)
@@ -248,6 +248,8 @@ void spi_release_bus(struct spi_slave *slave)
 static int spi_pio_xfer(struct bfin_spi_slave *bss, const u8 *tx, u8 *rx,
                        uint bytes)
 {
+       /* discard invalid data and clear RXS */
+       read_SPI_RDBR(bss);
        /* todo: take advantage of hardware fifos  */
        while (bytes--) {
                u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);