diff options
author | Jarod Wilson <jarod@redhat.com> | 2010-11-09 16:11:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-20 11:11:06 -0500 |
commit | b7582815b3fc772e23ee5da884e9a2307bdc1025 (patch) | |
tree | 98c3f769ec1eb65883801fa5d4c02d176afa1619 /drivers/media/IR/nuvoton-cir.c | |
parent | 6f6c625d32852ab2fbfd131ba9a1e5d55ff8032c (diff) |
[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>
Diffstat (limited to 'drivers/media/IR/nuvoton-cir.c')
-rw-r--r-- | drivers/media/IR/nuvoton-cir.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c index 301be53aee85..acc729c79cec 100644 --- a/drivers/media/IR/nuvoton-cir.c +++ b/drivers/media/IR/nuvoton-cir.c | |||
@@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
603 | count = nvt->pkts; | 603 | count = nvt->pkts; |
604 | nvt_dbg_verbose("Processing buffer of len %d", count); | 604 | nvt_dbg_verbose("Processing buffer of len %d", count); |
605 | 605 | ||
606 | init_ir_raw_event(&rawir); | ||
607 | |||
606 | for (i = 0; i < count; i++) { | 608 | for (i = 0; i < count; i++) { |
607 | nvt->pkts--; | 609 | nvt->pkts--; |
608 | sample = nvt->buf[i]; | 610 | sample = nvt->buf[i]; |
@@ -643,11 +645,15 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
643 | * indicates end of IR signal, but new data incoming. In both | 645 | * indicates end of IR signal, but new data incoming. In both |
644 | * cases, it means we're ready to call ir_raw_event_handle | 646 | * cases, it means we're ready to call ir_raw_event_handle |
645 | */ | 647 | */ |
646 | if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) && | 648 | if ((sample == BUF_PULSE_BIT) && nvt->pkts) { |
647 | (sample & BUF_REPEAT_MASK) == BUF_REPEAT_BYTE)) | 649 | nvt_dbg("Calling ir_raw_event_handle (signal end)\n"); |
648 | ir_raw_event_handle(nvt->rdev); | 650 | ir_raw_event_handle(nvt->rdev); |
651 | } | ||
649 | } | 652 | } |
650 | 653 | ||
654 | nvt_dbg("Calling ir_raw_event_handle (buffer empty)\n"); | ||
655 | ir_raw_event_handle(nvt->rdev); | ||
656 | |||
651 | if (nvt->pkts) { | 657 | if (nvt->pkts) { |
652 | nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts); | 658 | nvt_dbg("Odd, pkts should be 0 now... (its %u)", nvt->pkts); |
653 | nvt->pkts = 0; | 659 | nvt->pkts = 0; |