summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 16:39:00 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 16:39:00 -0300
commit3ad1ced40a8f78c03dd7af87fc1fc14b90dd4d06 (patch)
tree72f61fed005190648bda011ce2e1aa0699979e8b /linux/drivers/media/video/ir-kbd-i2c.c
parent9e37591ebf7dd9108a308b367cbe01f13c6b6b3c (diff)
downloadmediapointer-dvb-s2-3ad1ced40a8f78c03dd7af87fc1fc14b90dd4d06.tar.gz
mediapointer-dvb-s2-3ad1ced40a8f78c03dd7af87fc1fc14b90dd4d06.tar.bz2
Allow RC5 codes 64 - 127 in ir-kbd-i2c.c
From: David Hardeman <david@hardeman.nu> The RC5 coding has for a long time supported commands 64-127 in addition to 0-63. This is controlled by the second bit of the RC5 packet (see The attached patch modifies ir-kbd-i2c.c to allow for commands 64-127, tested with a PVR350 card in combination with a programmable remote. Signed-off-by: David Hardeman <david@hardeman.nu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--linux/drivers/media/video/ir-kbd-i2c.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
index 91ff43d93..b826dcca2 100644
--- a/linux/drivers/media/video/ir-kbd-i2c.c
+++ b/linux/drivers/media/video/ir-kbd-i2c.c
@@ -65,23 +65,32 @@ MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults
static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
{
unsigned char buf[3];
- int start, toggle, dev, code;
+ int start, range, toggle, dev, code;
/* poll IR chip */
if (3 != i2c_master_recv(&ir->c,buf,3))
return -EIO;
/* split rc5 data block ... */
- start = (buf[0] >> 6) & 3;
+ start = (buf[0] >> 7) & 1;
+ range = (buf[0] >> 6) & 1;
toggle = (buf[0] >> 5) & 1;
dev = buf[0] & 0x1f;
code = (buf[1] >> 2) & 0x3f;
- if (3 != start)
+ /* rc5 has two start bits
+ * the first bit must be one
+ * the second bit defines the command range (1 = 0-63, 0 = 64 - 127)
+ */
+ if (!start)
/* no key pressed */
return 0;
- dprintk(1,"ir hauppauge (rc5): s%d t%d dev=%d code=%d\n",
- start, toggle, dev, code);
+
+ if (!range)
+ code += 64;
+
+ dprintk(1,"ir hauppauge (rc5): s%d r%d t%d dev=%d code=%d\n",
+ start, range, toggle, dev, code);
/* return key */
*ir_key = code;