diff options
author | Thomas Genty <tomlohave@gmail.com> | 2006-11-29 19:57:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 06:05:29 -0500 |
commit | 177aaaf826856cd8c82e790cf125186b5634f492 (patch) | |
tree | 2af2452c7839496ba7c7becc1b5e7e975159f9ad /drivers/media/video/saa7134/saa7134-input.c | |
parent | 4be3276a66c09e68a539253ce660913bb2585984 (diff) |
V4L/DVB (4898): Saa7134: add support for remote control of Hauppauge HVR1110
This patch adds support for the remote control bundled with the
Hauppauge HVR1110
Signed-off-by: Thomas Genty <tomlohave@gmail.com>
Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-input.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index 5d2bf15239f7..60b38defd9bc 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -112,6 +112,27 @@ static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | |||
112 | return 1; | 112 | return 1; |
113 | } | 113 | } |
114 | 114 | ||
115 | static int get_key_hvr1110(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw) | ||
116 | { | ||
117 | unsigned char buf[5], cod4, code3, code4; | ||
118 | |||
119 | /* poll IR chip */ | ||
120 | if (5 != i2c_master_recv(&ir->c,buf,5)) | ||
121 | return -EIO; | ||
122 | |||
123 | cod4 = buf[4]; | ||
124 | code4 = (cod4 >> 2); | ||
125 | code3 = buf[3]; | ||
126 | if (code3 == 0) | ||
127 | /* no key pressed */ | ||
128 | return 0; | ||
129 | |||
130 | /* return key */ | ||
131 | *ir_key = code4; | ||
132 | *ir_raw = code4; | ||
133 | return 1; | ||
134 | } | ||
135 | |||
115 | void saa7134_input_irq(struct saa7134_dev *dev) | 136 | void saa7134_input_irq(struct saa7134_dev *dev) |
116 | { | 137 | { |
117 | struct saa7134_ir *ir = dev->remote; | 138 | struct saa7134_ir *ir = dev->remote; |
@@ -371,6 +392,11 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir) | |||
371 | ir->get_key = get_key_purpletv; | 392 | ir->get_key = get_key_purpletv; |
372 | ir->ir_codes = ir_codes_purpletv; | 393 | ir->ir_codes = ir_codes_purpletv; |
373 | break; | 394 | break; |
395 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: | ||
396 | snprintf(ir->c.name, sizeof(ir->c.name), "HVR 1110"); | ||
397 | ir->get_key = get_key_hvr1110; | ||
398 | ir->ir_codes = ir_codes_hauppauge_new; | ||
399 | break; | ||
374 | default: | 400 | default: |
375 | dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board); | 401 | dprintk("Shouldn't get here: Unknown board %x for I2C IR?\n",dev->board); |
376 | break; | 402 | break; |