]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
spi: bcm2835aux: disable tx fifo empty irq
authorStephan Olbrich <stephanolbrich@gmx.de>
Tue, 9 Feb 2016 18:10:33 +0000 (19:10 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 10 Feb 2016 19:14:57 +0000 (19:14 +0000)
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>
drivers/spi/spi-bcm2835aux.c

index 7de6f8472a8100656884647ad5447be94604e7bb..e1b2fec1db63122770a16b3cef2d99a379e5a4c8 100644 (file)
@@ -212,6 +212,12 @@ static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
                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 */
        if (!bs->rx_len) {
                bcm2835aux_spi_reset_hw(bs);