[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: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by Jarod Wilson and committed by Mauro Carvalho Chehab b7582815 6f6c625d

+8 -2
+8 -2
drivers/media/IR/nuvoton-cir.c
··· 603 count = nvt->pkts; 604 nvt_dbg_verbose("Processing buffer of len %d", count); 605 606 for (i = 0; i < count; i++) { 607 nvt->pkts--; 608 sample = nvt->buf[i]; ··· 645 * indicates end of IR signal, but new data incoming. In both 646 * cases, it means we're ready to call ir_raw_event_handle 647 */ 648 - if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) && 649 - (sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE)) 650 ir_raw_event_handle(nvt->rdev); 651 } 652 653 if (nvt->pkts) { 654 nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);
··· 603 count = nvt->pkts; 604 nvt_dbg_verbose("Processing buffer of len %d", count); 605 606 + init_ir_raw_event(&rawir); 607 + 608 for (i = 0; i < count; i++) { 609 nvt->pkts--; 610 sample = nvt->buf[i]; ··· 643 * indicates end of IR signal, but new data incoming. In both 644 * cases, it means we're ready to call ir_raw_event_handle 645 */ 646 + if ((sample == BUF_PULSE_BIT) && nvt->pkts) { 647 + nvt_dbg("Calling ir_raw_event_handle (signal end)\n"); 648 ir_raw_event_handle(nvt->rdev); 649 + } 650 } 651 + 652 + nvt_dbg("Calling ir_raw_event_handle (buffer empty)\n"); 653 + ir_raw_event_handle(nvt->rdev); 654 655 if (nvt->pkts) { 656 nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts);