]> bbs.cooldavid.org Git - net-next-2.6.git/commit
V4L/DVB: ir-nec-decoder: Reimplement the entire decoder
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 3 Apr 2010 21:51:50 +0000 (18:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:56:55 +0000 (12:56 -0300)
commit2f16f6315f583964732bc23c873d4024281d763c
treea20f719a7d4aef15a24f55f4c6e1aaaa90c8a8b7
parent13c24497086418010bf4f76378bcae241d7f59cd
V4L/DVB: ir-nec-decoder: Reimplement the entire decoder

Thanks to Andy Walls <awalls@md.metrocast.net> for pointing me his
code, that gave me some ideas to better implement it.

After some work with saa7134 bits, I found a way to catch both IRQ
edge pulses. By enabling it, the NEC decoder can now take both
pulse and spaces into account, making it more precise.

Instead of the old strategy of handling the events all at once,
this code implements a state machine. Due to that, it handles
individual pulse or space events, validating them against the
protocol, producing a much more reliable decoding.

With the new implementation, the protocol trailer bits are properly
handled, making possible for the repeat key to work.

Also, the code is now capable of handling both NEC and NEC extended
IR devices. With NEC, it produces a 16 bits code, while with NEC
extended, a 24 bits code is returned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-nec-decoder.c
drivers/media/video/saa7134/saa7134-input.c