spi: sun4i: Poll for rxfifo to be filled up
authorJagan Teki <jagan@amarulasolutions.com>
Wed, 27 Feb 2019 14:32:05 +0000 (20:02 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 4 Mar 2019 12:38:56 +0000 (18:08 +0530)
commit6cb6aa602b541d2b2f864c47b6a3f62e3eefe282
tree20942c0559785a51f7b9b0c638f52935a942c0ad
parent1b77de4476637a614d23b34bcfae0b788409389c
spi: sun4i: Poll for rxfifo to be filled up

To drain rx fifo the fifo need to poll for how much data has
been filled up in rx fifo.

To achieve this, the current code is using wait_for_bit logic
on control register with exchange burst mode mask, which is not
a proper way of waiting for fifo filled up.

So, add code for polling rxfifo to be filled up using fifo
status register.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
drivers/spi/sun4i_spi.c