aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Genty <tomlohave@gmail.com>2006-11-29 19:57:24 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-12-10 06:05:29 -0500
commit177aaaf826856cd8c82e790cf125186b5634f492 (patch)
tree2af2452c7839496ba7c7becc1b5e7e975159f9ad
parent4be3276a66c09e68a539253ce660913bb2585984 (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>
-rw-r--r--drivers/media/video/ir-kbd-i2c.c3
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c11
-rw-r--r--drivers/media/video/saa7134/saa7134-i2c.c1
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c26
4 files changed, 38 insertions, 3 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index dd6341f2e390..59edf58204de 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -354,6 +354,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
354 break; 354 break;
355 case 0x7a: 355 case 0x7a:
356 case 0x47: 356 case 0x47:
357 case 0x71:
357 /* Handled by saa7134-input */ 358 /* Handled by saa7134-input */
358 name = "SAA713x remote"; 359 name = "SAA713x remote";
359 ir_type = IR_TYPE_OTHER; 360 ir_type = IR_TYPE_OTHER;
@@ -448,7 +449,7 @@ static int ir_probe(struct i2c_adapter *adap)
448 */ 449 */
449 450
450 static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1}; 451 static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
451 static const int probe_saa7134[] = { 0x7a, 0x47, -1 }; 452 static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
452 static const int probe_em28XX[] = { 0x30, 0x47, -1 }; 453 static const int probe_em28XX[] = { 0x30, 0x47, -1 };
453 const int *probe = NULL; 454 const int *probe = NULL;
454 struct i2c_client c; 455 struct i2c_client c;
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index d0ddc65d7eb1..4dead84aff46 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -3135,17 +3135,23 @@ struct saa7134_board saa7134_boards[] = {
3135 .tuner_addr = ADDR_UNSET, 3135 .tuner_addr = ADDR_UNSET,
3136 .radio_addr = ADDR_UNSET, 3136 .radio_addr = ADDR_UNSET,
3137 .mpeg = SAA7134_MPEG_DVB, 3137 .mpeg = SAA7134_MPEG_DVB,
3138 .gpiomask = 0x000200000,
3139 .inputs = {{ 3138 .inputs = {{
3140 .name = name_tv, 3139 .name = name_tv,
3141 .vmux = 1, 3140 .vmux = 1,
3142 .amux = TV, 3141 .amux = TV,
3143 .tv = 1, 3142 .tv = 1,
3143 },{
3144 .name = name_comp1,
3145 .vmux = 3,
3146 .amux = LINE2, /* FIXME: audio doesn't work on svideo/composite */
3147 },{
3148 .name = name_svideo,
3149 .vmux = 8,
3150 .amux = LINE2, /* FIXME: audio doesn't work on svideo/composite */
3144 }}, 3151 }},
3145 .radio = { 3152 .radio = {
3146 .name = name_radio, 3153 .name = name_radio,
3147 .amux = TV, 3154 .amux = TV,
3148 .gpio = 0x0200000,
3149 }, 3155 },
3150 }, 3156 },
3151 [SAA7134_BOARD_CINERGY_HT_PCMCIA] = { 3157 [SAA7134_BOARD_CINERGY_HT_PCMCIA] = {
@@ -3976,6 +3982,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3976 case SAA7134_BOARD_PINNACLE_PCTV_110i: 3982 case SAA7134_BOARD_PINNACLE_PCTV_110i:
3977 case SAA7134_BOARD_PINNACLE_PCTV_310i: 3983 case SAA7134_BOARD_PINNACLE_PCTV_310i:
3978 case SAA7134_BOARD_UPMOST_PURPLE_TV: 3984 case SAA7134_BOARD_UPMOST_PURPLE_TV:
3985 case SAA7134_BOARD_HAUPPAUGE_HVR1110:
3979 dev->has_remote = SAA7134_REMOTE_I2C; 3986 dev->has_remote = SAA7134_REMOTE_I2C;
3980 break; 3987 break;
3981 case SAA7134_BOARD_AVERMEDIA_A169_B: 3988 case SAA7134_BOARD_AVERMEDIA_A169_B:
diff --git a/drivers/media/video/saa7134/saa7134-i2c.c b/drivers/media/video/saa7134/saa7134-i2c.c
index 6162550c4136..6f9fe86fed98 100644
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@ -341,6 +341,7 @@ static int attach_inform(struct i2c_client *client)
341 switch (client->addr) { 341 switch (client->addr) {
342 case 0x7a: 342 case 0x7a:
343 case 0x47: 343 case 0x47:
344 case 0x71:
344 { 345 {
345 struct IR_i2c *ir = i2c_get_clientdata(client); 346 struct IR_i2c *ir = i2c_get_clientdata(client);
346 d1printk("%s i2c IR detected (%s).\n", 347 d1printk("%s i2c IR detected (%s).\n",
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
115static 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
115void saa7134_input_irq(struct saa7134_dev *dev) 136void 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;