Skip to content

Commit

Permalink
[media] nuvoton-cir: improve buffer parsing responsiveness
Browse files Browse the repository at this point in the history
Rather than waiting for trigger bits, the formula for which was slightly
messy, and apparently, not actually 100% complete for some remotes, just
call ir_raw_event_handle whenever we finish parsing a chunk of data from
the rx fifo, similar to mceusb, as well as whenever we see an 'end of
signal data' 0x80 packet.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed Dec 20, 2010
1 parent 6f6c625 commit b758281
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/media/IR/nuvoton-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
count = nvt->pkts;
nvt_dbg_verbose("Processing buffer of len %d", count);

init_ir_raw_event(&rawir);

for (i = 0; i < count; i++) {
nvt->pkts--;
sample = nvt->buf[i];
Expand Down Expand Up @@ -643,11 +645,15 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
* indicates end of IR signal, but new data incoming. In both
* cases, it means we're ready to call ir_raw_event_handle
*/
if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) &&
(sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE))
if ((sample == BUF_PULSE_BIT) && nvt->pkts) {
nvt_dbg("Calling ir_raw_event_handle (signal end)\n");
ir_raw_event_handle(nvt->rdev);
}
}

nvt_dbg("Calling ir_raw_event_handle (buffer empty)\n");
ir_raw_event_handle(nvt->rdev);

if (nvt->pkts) {
nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);
nvt->pkts = 0;
Expand Down

0 comments on commit b758281

Please sign in to comment.