summaryrefslogtreecommitdiff
path: root/linux/include
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-08-05 10:03:17 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-08-05 10:03:17 -0300
commitb09fc65be0f74fa20c47c31d00ddf7553a4749ee (patch)
treecea70338c9ed3ffb10b271c4e0d5bb2b440faf13 /linux/include
parentb9ae36cc08d88d25ef5326e857fbea45b7e36588 (diff)
downloadmediapointer-dvb-s2-b09fc65be0f74fa20c47c31d00ddf7553a4749ee.tar.gz
mediapointer-dvb-s2-b09fc65be0f74fa20c47c31d00ddf7553a4749ee.tar.bz2
saa7134: Add NEC prococol IR decoding capability
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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. Priority: normal Signed-off-by: Gilberto <gilberto@sistemafenix.com.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/include')
-rw-r--r--linux/include/media/ir-common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/include/media/ir-common.h b/linux/include/media/ir-common.h
index b8e8aa919..f5566d438 100644
--- a/linux/include/media/ir-common.h
+++ b/linux/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,