From: Mark A. Greer Date: Tue, 25 Mar 2014 15:54:32 +0000 (-0700) Subject: NFC: trf7970a: Reset FIFO when 'End of TX' Interrupt Occurs X-Git-Tag: next-20140530~73^2~60^2~36 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4dd836e46c3ddcb2020646c867be589658440be0;p=karo-tx-linux.git NFC: trf7970a: Reset FIFO when 'End of TX' Interrupt Occurs 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 Signed-off-by: Samuel Ortiz --- diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index df634498c81b..a2e0a21d6ea2 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -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;