Commit aff0564a authored by Mark A. Greer's avatar Mark A. Greer Committed by Samuel Ortiz

NFC: trf7970a: Clear possible spurious interrupt before transmitting

The trf7970a occasionally generates spurious interrupts
which can confuse the driver.  To help alleviate this,
clear any interrupts by reading the 'IRQ Status Register'
before starting a new transaction.
Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 38b4eb1f
......@@ -1120,6 +1120,7 @@ static int trf7970a_in_send_cmd(struct nfc_digital_dev *ddev,
char *prefix;
unsigned int len;
int ret;
u8 status;
dev_dbg(trf->dev, "New request - state: %d, timeout: %d ms, len: %d\n",
trf->state, timeout, skb->len);
......@@ -1195,6 +1196,11 @@ static int trf7970a_in_send_cmd(struct nfc_digital_dev *ddev,
len = min_t(int, skb->len, TRF7970A_FIFO_SIZE);
/* Clear possible spurious interrupt */
ret = trf7970a_read_irqstatus(trf, &status);
if (ret)
goto out_err;
ret = trf7970a_transmit(trf, skb, len);
if (ret) {
kfree_skb(trf->rx_skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment