Skip to content
Snippets Groups Projects
Commit d4d4f903 authored by Scott Jiang's avatar Scott Jiang Committed by Sonic Zhang
Browse files

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: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
parent e76276df
No related branches found
No related tags found
No related merge requests found
...@@ -248,6 +248,8 @@ void spi_release_bus(struct spi_slave *slave) ...@@ -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, static int spi_pio_xfer(struct bfin_spi_slave *bss, const u8 *tx, u8 *rx,
uint bytes) uint bytes)
{ {
/* discard invalid data and clear RXS */
read_SPI_RDBR(bss);
/* todo: take advantage of hardware fifos */ /* todo: take advantage of hardware fifos */
while (bytes--) { while (bytes--) {
u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL); u8 value = (tx ? *tx++ : CONFIG_BFIN_SPI_IDLE_VAL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment