diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 23:49:57 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 23:49:57 -0200 |
commit | ba7457fc4d28e1b336aaa55c60d3814c310f9fd8 (patch) | |
tree | c6e2921c1aa0c11a0f743c01e3fcd42124410138 /linux/drivers/media/video/ir-kbd-i2c.c | |
parent | 667e11f6005391136bad274d2333240d54b08294 (diff) | |
parent | 10b29761e7203ebceee27adfb5d3e92803f2512e (diff) | |
download | mediapointer-dvb-s2-ba7457fc4d28e1b336aaa55c60d3814c310f9fd8.tar.gz mediapointer-dvb-s2-ba7457fc4d28e1b336aaa55c60d3814c310f9fd8.tar.bz2 |
merge: http://linuxtv.org/hg/~anttip/af9015/
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/ir-kbd-i2c.c')
-rw-r--r-- | linux/drivers/media/video/ir-kbd-i2c.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c index 73fcfddce..038a5c04b 100644 --- a/linux/drivers/media/video/ir-kbd-i2c.c +++ b/linux/drivers/media/video/ir-kbd-i2c.c @@ -66,7 +66,7 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw, int size, int offset) { unsigned char buf[6]; - int start, range, toggle, dev, code; + int start, range, toggle, dev, code, ircode; /* poll IR chip */ if (size != i2c_master_recv(&ir->c,buf,size)) @@ -86,6 +86,24 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw, if (!start) /* no key pressed */ return 0; + /* + * Hauppauge remotes (black/silver) always use + * specific device ids. If we do not filter the + * device ids then messages destined for devices + * such as TVs (id=0) will get through causing + * mis-fired events. + * + * We also filter out invalid key presses which + * produce annoying debug log entries. + */ + ircode= (start << 12) | (toggle << 11) | (dev << 6) | code; + if ((ircode & 0x1fff)==0x1fff) + /* invalid key press */ + return 0; + + if (dev!=0x1e && dev!=0x1f) + /* not a hauppauge remote */ + return 0; if (!range) code += 64; @@ -95,7 +113,7 @@ static int get_key_haup_common(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw, /* return key */ *ir_key = code; - *ir_raw = (start << 12) | (toggle << 11) | (dev << 6) | code; + *ir_raw = ircode; return 1; } |