|
|
@@ -180,12 +180,12 @@ static void bcm2835aux_spi_reset_hw(struct bcm2835aux_spi *bs)
|
|
|
|
|
|
static void bcm2835aux_spi_transfer_helper(struct bcm2835aux_spi *bs)
|
|
|
{
|
|
|
+ u32 stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT);
|
|
|
+
|
|
|
/* check if we have data to read */
|
|
|
- while (bs->rx_len &&
|
|
|
- (!(bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT) &
|
|
|
- BCM2835_AUX_SPI_STAT_RX_EMPTY))) {
|
|
|
+ for (; bs->rx_len && (stat & BCM2835_AUX_SPI_STAT_RX_LVL);
|
|
|
+ stat = bcm2835aux_rd(bs, BCM2835_AUX_SPI_STAT))
|
|
|
bcm2835aux_rd_fifo(bs);
|
|
|
- }
|
|
|
|
|
|
/* check if we have data to write */
|
|
|
while (bs->tx_len &&
|