Browse Source

spi: bcm2835aux: disable tx fifo empty irq

The tx empty irq can be disabled when all data was copied.
This prevents unnecessary interrupts while the last bytes are sent.

Signed-off-by: Stephan Olbrich <stephanolbrich@gmx.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
Stephan Olbrich 9 years ago
parent
commit
f29ab1845f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      drivers/spi/spi-bcm2835aux.c

+ 6 - 0
drivers/spi/spi-bcm2835aux.c

@@ -212,6 +212,12 @@ static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
 		ret = IRQ_HANDLED;
 		ret = IRQ_HANDLED;
 	}
 	}
 
 
+	if (!bs->tx_len) {
+		/* disable tx fifo empty interrupt */
+		bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1] |
+			BCM2835_AUX_SPI_CNTL1_IDLE);
+	}
+
 	/* and if rx_len is 0 then wake up completion and disable spi */
 	/* and if rx_len is 0 then wake up completion and disable spi */
 	if (!bs->rx_len) {
 	if (!bs->rx_len) {
 		bcm2835aux_spi_reset_hw(bs);
 		bcm2835aux_spi_reset_hw(bs);