V4L/DVB: Teach drivers/media/IR/ir-raw-event.c to use durations
authorDavid Härdeman <david@hardeman.nu>
Thu, 8 Apr 2010 16:10:00 +0000 (13:10 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:57:03 +0000 (12:57 -0300)
commit724e2495502a98aaa3f93c404472a991da8ff857
treedfdc90b4408fa95f7757b1c6e5b36c2789da0df2
parentd22e546ea18ee66c255af906f2714d3ee82d4b42
V4L/DVB: Teach drivers/media/IR/ir-raw-event.c to use durations

drivers/media/IR/ir-raw-event.c is currently written with the assumption
that all "raw" hardware will generate events only on state change (i.e.
when a pulse or space starts).

However, some hardware (like mceusb, probably the most popular IR receiver
out there) only generates duration data (and that data is buffered so using
any kind of timing on the data is futile).

Furthermore, using signed int's to represent pulse/space durations is a
well-known approach when writing ir decoders.

With this patch:

- s64 int's are used to represent pulse/space durations in ns

- a workqueue is used to decode the ir protocols outside of interrupt context

- #defines are added to make decoders clearer

- decoder reset is implemented by passing a zero duration to the kfifo queue
  and decoders are updated accordingly

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-nec-decoder.c
drivers/media/IR/ir-raw-event.c
drivers/media/IR/ir-rc5-decoder.c
drivers/media/video/saa7134/saa7134-input.c
include/media/ir-core.h