Commit b7582815 authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[media] nuvoton-cir: improve buffer parsing responsiveness

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: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6f6c625d
...@@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) ...@@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
count = nvt->pkts; count = nvt->pkts;
nvt_dbg_verbose("Processing buffer of len %d", count); nvt_dbg_verbose("Processing buffer of len %d", count);
init_ir_raw_event(&rawir);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
nvt->pkts--; nvt->pkts--;
sample = nvt->buf[i]; sample = nvt->buf[i];
...@@ -643,11 +645,15 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) ...@@ -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 * indicates end of IR signal, but new data incoming. In both
* cases, it means we're ready to call ir_raw_event_handle * cases, it means we're ready to call ir_raw_event_handle
*/ */
if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) && if ((sample == BUF_PULSE_BIT) && nvt->pkts) {
(sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE)) nvt_dbg("Calling ir_raw_event_handle (signal end)\n");
ir_raw_event_handle(nvt->rdev); 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) { if (nvt->pkts) {
nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts); nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);
nvt->pkts = 0; nvt->pkts = 0;
......
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