瀏覽代碼

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>
Scott Jiang 13 年之前
父節點
當前提交
d4d4f90377
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/spi/bfin_spi.c

+ 2 - 0
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);