aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorScott Jiang2011-12-07 14:53:30 -0500
committerSonic Zhang2013-05-13 16:26:27 +0800
commitd4d4f903773e0e5540baa00157585de25a542ba6 (patch)
tree4d4b4bd66d747838a8a9ecf539fda92307f5e070 /drivers/spi
parente76276df74f60eeb3c28418971bbe8cd6fc736e5 (diff)
bfin: discard invalid data and clear RXS in bf5xx spi driver
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/bfin_spi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index 0fa131b21df..a9a4d92c3e7 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -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);