summaryrefslogtreecommitdiff
path: root/include/media/ir-common.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-08-05 10:03:17 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 09:36:47 -0200
commit622ecb300345d308c8b4a983ac112b1985d7d156 (patch)
tree2dd9156f8a5bb27826a939034d1ffa7cac671211 /include/media/ir-common.h
parentd56dc61265d2527a63ab5b0f03199a43cd89ca36 (diff)
V4L/DVB (8625): saa7134: Add NEC prococol IR decoding capability
This patch adds the capability of decoding NEC protocol, received via GPIO18 line. This GPIO port can trigger saa7134 IRQ. A future improvement would be to make it a little more generic to work also with GPIO16 line. A pure IRQ code didn't work, since some delays were introduced on the tests we did. A possible approach would be to use polling at a rate of 2.5 ms or less. If a new code were taken, a code similar to nec_task() could be used. However, this would add an extra overhead to kernel, and will consume more power. Due to that, we took an hybrid approach: an IRQ upper half to trigger when a new key is received and a bottom half to convert pulse-distance into a keycode. The bottom half is polling based, to improve performance. During the bottom half proccess, GPIO18 IRQ line is disabled, preventing IRQ reentrancy and improving performance a little bit. Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring this development. Signed-off-by: Gilberto <gilberto@sistemafenix.com.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/ir-common.h')
-rw-r--r--include/media/ir-common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index b8e8aa91905a..f5566d43894c 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -25,6 +25,7 @@
#include <linux/input.h>
#include <linux/workqueue.h>
+#include <linux/interrupt.h>
#define IR_TYPE_RC5 1
#define IR_TYPE_PD 2 /* Pulse distance encoded IR */
@@ -85,6 +86,10 @@ struct card_ir {
u32 code; /* raw code under construction */
struct timeval base_time; /* time of last seen code */
int active; /* building raw code */
+
+ /* NEC decoding */
+ u32 nec_gpio;
+ struct tasklet_struct tlet;
};
void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,