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

NFC: trf7970a: Only fill FIFO if there is space

Handle the case where trf7970a_fill_fifo() is
called but there is no room in the FIFO for
more TX data.  When this happens, wait for
another interrupt indicating that there is
now space (and set a timer in case that
interrupt never occurs).
Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 7a1e5552
...@@ -580,6 +580,12 @@ static void trf7970a_fill_fifo(struct trf7970a *trf) ...@@ -580,6 +580,12 @@ static void trf7970a_fill_fifo(struct trf7970a *trf)
/* Calculate how much more data can be written to the fifo */ /* Calculate how much more data can be written to the fifo */
len = TRF7970A_FIFO_SIZE - fifo_bytes; len = TRF7970A_FIFO_SIZE - fifo_bytes;
if (!len) {
schedule_delayed_work(&trf->timeout_work,
msecs_to_jiffies(TRF7970A_WAIT_FOR_FIFO_DRAIN_TIMEOUT));
return;
}
len = min(skb->len, len); len = min(skb->len, len);
prefix = TRF7970A_CMD_BIT_CONTINUOUS | TRF7970A_FIFO_IO_REGISTER; prefix = TRF7970A_CMD_BIT_CONTINUOUS | TRF7970A_FIFO_IO_REGISTER;
......
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