NFC: trf7970a: Reset FIFO when 'End of TX' Interrupt Occurs
authorMark A. Greer <mgreer@animalcreek.com>
Tue, 25 Mar 2014 15:54:32 +0000 (08:54 -0700)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 21 Apr 2014 22:37:27 +0000 (00:37 +0200)
Sometimes after sending a frame there is tx data leftover in the FIFO
which the driver will think is part of the receive frame. That data can
be cleared when an 'End of TX' interrupt is received by issuing the
'FIFO Reset' command.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/trf7970a.c

index df634498c81b4fb370fc929c1853ede16120c963..a2e0a21d6ea2de936d6544275d875c95241e5f07 100644 (file)
@@ -681,7 +681,9 @@ static irqreturn_t trf7970a_irq(int irq, void *dev_id)
                        trf->ignore_timeout =
                                !cancel_delayed_work(&trf->timeout_work);
                        trf7970a_drain_fifo(trf, status);
-               } else if (!(status & TRF7970A_IRQ_STATUS_TX)) {
+               } else if (status == TRF7970A_IRQ_STATUS_TX) {
+                       trf7970a_cmd(trf, TRF7970A_CMD_FIFO_RESET);
+               } else {
                        trf7970a_send_err_upstream(trf, -EIO);
                }
                break;