aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMagnus Alm <magnus.alm@gmail.com>2009-11-13 03:48:24 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:51 -0500
commitca39d84d438b609af127f2eb161cd9029afbc9a7 (patch)
tree04cccd6ae583ae496943248198af370c0d0be34a /drivers
parent5d26b6443292027314a2e2c9178140e60acd3587 (diff)
V4L/DVB: em28xx: fix for "Leadtek winfast tv usbii deluxe"
fix Video/Sound support "Leadtek winfast tv usbii deluxe". Now, it is working Stereo, IR, Radio, TV, Svideo and Composite. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/IR/ir-keymaps.c48
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c29
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c30
-rw-r--r--drivers/media/video/em28xx/em28xx.h2
-rw-r--r--drivers/media/video/ir-kbd-i2c.c1
5 files changed, 104 insertions, 6 deletions
diff --git a/drivers/media/IR/ir-keymaps.c b/drivers/media/IR/ir-keymaps.c
index 9bbe6b1e9871..71b3278f67e5 100644
--- a/drivers/media/IR/ir-keymaps.c
+++ b/drivers/media/IR/ir-keymaps.c
@@ -3393,3 +3393,51 @@ struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table = {
3393}; 3393};
3394EXPORT_SYMBOL_GPL(ir_codes_nec_terratec_cinergy_xs_table); 3394EXPORT_SYMBOL_GPL(ir_codes_nec_terratec_cinergy_xs_table);
3395 3395
3396
3397/* Leadtek Winfast TV USB II Deluxe remote
3398 Magnus Alm <magnus.alm@gmail.com>
3399 */
3400static struct ir_scancode ir_codes_winfast_usbii_deluxe[] = {
3401 { 0x62, KEY_0},
3402 { 0x75, KEY_1},
3403 { 0x76, KEY_2},
3404 { 0x77, KEY_3},
3405 { 0x79, KEY_4},
3406 { 0x7a, KEY_5},
3407 { 0x7b, KEY_6},
3408 { 0x7d, KEY_7},
3409 { 0x7e, KEY_8},
3410 { 0x7f, KEY_9},
3411
3412 { 0x38, KEY_CAMERA}, /* SNAPSHOT */
3413 { 0x37, KEY_RECORD}, /* RECORD */
3414 { 0x35, KEY_TIME}, /* TIMESHIFT */
3415
3416 { 0x74, KEY_VOLUMEUP}, /* VOLUMEUP */
3417 { 0x78, KEY_VOLUMEDOWN}, /* VOLUMEDOWN */
3418 { 0x64, KEY_MUTE}, /* MUTE */
3419
3420 { 0x21, KEY_CHANNEL}, /* SURF */
3421 { 0x7c, KEY_CHANNELUP}, /* CHANNELUP */
3422 { 0x60, KEY_CHANNELDOWN}, /* CHANNELDOWN */
3423 { 0x61, KEY_LAST}, /* LAST CHANNEL (RECALL) */
3424
3425 { 0x72, KEY_VIDEO}, /* INPUT MODES (TV/FM) */
3426
3427 { 0x70, KEY_POWER2}, /* TV ON/OFF */
3428
3429 { 0x39, KEY_CYCLEWINDOWS}, /* MINIMIZE (BOSS) */
3430 { 0x3a, KEY_NEW}, /* PIP */
3431 { 0x73, KEY_ZOOM}, /* FULLSECREEN */
3432
3433 { 0x66, KEY_INFO}, /* OSD (DISPLAY) */
3434
3435 { 0x31, KEY_DOT}, /* '.' */
3436 { 0x63, KEY_ENTER}, /* ENTER */
3437
3438};
3439struct ir_scancode_table ir_codes_winfast_usbii_deluxe_table = {
3440 .scan = ir_codes_winfast_usbii_deluxe,
3441 .size = ARRAY_SIZE(ir_codes_winfast_usbii_deluxe),
3442};
3443EXPORT_SYMBOL_GPL(ir_codes_winfast_usbii_deluxe_table);
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 25100001ffff..b1c5d9516e22 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -461,21 +461,30 @@ struct em28xx_board em28xx_boards[] = {
461 .name = "Leadtek Winfast USB II Deluxe", 461 .name = "Leadtek Winfast USB II Deluxe",
462 .valid = EM28XX_BOARD_NOT_VALIDATED, 462 .valid = EM28XX_BOARD_NOT_VALIDATED,
463 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, 463 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
464 .tda9887_conf = TDA9887_PRESENT, 464 .has_ir_i2c = 1,
465 .tvaudio_addr = 0x58,
466 .tda9887_conf = TDA9887_PRESENT |
467 TDA9887_PORT2_ACTIVE |
468 TDA9887_QSS,
465 .decoder = EM28XX_SAA711X, 469 .decoder = EM28XX_SAA711X,
470 .adecoder = EM28XX_TVAUDIO,
466 .input = { { 471 .input = { {
467 .type = EM28XX_VMUX_TELEVISION, 472 .type = EM28XX_VMUX_TELEVISION,
468 .vmux = SAA7115_COMPOSITE2, 473 .vmux = SAA7115_COMPOSITE4,
469 .amux = EM28XX_AMUX_VIDEO, 474 .amux = EM28XX_AMUX_AUX,
470 }, { 475 }, {
471 .type = EM28XX_VMUX_COMPOSITE1, 476 .type = EM28XX_VMUX_COMPOSITE1,
472 .vmux = SAA7115_COMPOSITE0, 477 .vmux = SAA7115_COMPOSITE5,
473 .amux = EM28XX_AMUX_LINE_IN, 478 .amux = EM28XX_AMUX_LINE_IN,
474 }, { 479 }, {
475 .type = EM28XX_VMUX_SVIDEO, 480 .type = EM28XX_VMUX_SVIDEO,
476 .vmux = SAA7115_COMPOSITE0, 481 .vmux = SAA7115_SVIDEO3,
477 .amux = EM28XX_AMUX_LINE_IN, 482 .amux = EM28XX_AMUX_LINE_IN,
478 } }, 483 } },
484 .radio = {
485 .type = EM28XX_RADIO,
486 .amux = EM28XX_AMUX_AUX,
487 }
479 }, 488 },
480 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = { 489 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
481 .name = "Videology 20K14XUSB USB2.0", 490 .name = "Videology 20K14XUSB USB2.0",
@@ -2259,9 +2268,12 @@ static int em28xx_hint_board(struct em28xx *dev)
2259/* ----------------------------------------------------------------------- */ 2268/* ----------------------------------------------------------------------- */
2260void em28xx_register_i2c_ir(struct em28xx *dev) 2269void em28xx_register_i2c_ir(struct em28xx *dev)
2261{ 2270{
2271 /* Leadtek winfast tv USBII deluxe can find a non working IR-device */
2272 /* at address 0x18, so if that address is needed for another board in */
2273 /* the future, please put it after 0x1f. */
2262 struct i2c_board_info info; 2274 struct i2c_board_info info;
2263 const unsigned short addr_list[] = { 2275 const unsigned short addr_list[] = {
2264 0x30, 0x47, I2C_CLIENT_END 2276 0x1f, 0x30, 0x47, I2C_CLIENT_END
2265 }; 2277 };
2266 2278
2267 if (disable_ir) 2279 if (disable_ir)
@@ -2344,6 +2356,11 @@ void em28xx_card_setup(struct em28xx *dev)
2344 dev->board.has_msp34xx = 1; 2356 dev->board.has_msp34xx = 1;
2345 } 2357 }
2346 break; 2358 break;
2359 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE:
2360 dev->init_data.ir_codes = &ir_codes_winfast_usbii_deluxe_table;;
2361 dev->init_data.get_key = em28xx_get_key_winfast_usbii_deluxe;
2362 dev->init_data.name = "i2c IR (EM2820 Winfast TV USBII Deluxe)";
2363 break;
2347 } 2364 }
2348 case EM2882_BOARD_KWORLD_ATSC_315U: 2365 case EM2882_BOARD_KWORLD_ATSC_315U:
2349 em28xx_write_reg(dev, 0x0d, 0x42); 2366 em28xx_write_reg(dev, 0x0d, 0x42);
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 69dcf0cc1f1e..1fb754e20875 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -184,6 +184,36 @@ int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
184 return 1; 184 return 1;
185} 185}
186 186
187int em28xx_get_key_winfast_usbii_deluxe(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
188{
189 unsigned char subaddr, keydetect, key;
190
191 struct i2c_msg msg[] = { { .addr = ir->c->addr, .flags = 0, .buf = &subaddr, .len = 1},
192
193 { .addr = ir->c->addr, .flags = I2C_M_RD, .buf = &keydetect, .len = 1} };
194
195 subaddr = 0x10;
196 if (2 != i2c_transfer(ir->c->adapter, msg, 2)) {
197 i2cdprintk("read error\n");
198 return -EIO;
199 }
200 if (keydetect == 0x00)
201 return 0;
202
203 subaddr = 0x00;
204 msg[1].buf = &key;
205 if (2 != i2c_transfer(ir->c->adapter, msg, 2)) {
206 i2cdprintk("read error\n");
207 return -EIO;
208 }
209 if (key == 0x00)
210 return 0;
211
212 *ir_key = key;
213 *ir_raw = key;
214 return 1;
215}
216
187/********************************************************** 217/**********************************************************
188 Poll based get keycode functions 218 Poll based get keycode functions
189 **********************************************************/ 219 **********************************************************/
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 71e90dc66582..0cb8d151cd0b 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -694,6 +694,8 @@ int em28xx_get_key_terratec(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
694int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw); 694int em28xx_get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw);
695int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key, 695int em28xx_get_key_pinnacle_usb_grey(struct IR_i2c *ir, u32 *ir_key,
696 u32 *ir_raw); 696 u32 *ir_raw);
697int em28xx_get_key_winfast_usbii_deluxe(struct IR_i2c *ir, u32 *ir_key,
698 u32 *ir_raw);
697void em28xx_register_snapshot_button(struct em28xx *dev); 699void em28xx_register_snapshot_button(struct em28xx *dev);
698void em28xx_deregister_snapshot_button(struct em28xx *dev); 700void em28xx_deregister_snapshot_button(struct em28xx *dev);
699 701
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 094e21dbb14f..da18d698e7f2 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -331,6 +331,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
331 ir_codes = &ir_codes_pv951_table; 331 ir_codes = &ir_codes_pv951_table;
332 break; 332 break;
333 case 0x18: 333 case 0x18:
334 case 0x1f:
334 case 0x1a: 335 case 0x1a:
335 name = "Hauppauge"; 336 name = "Hauppauge";
336 ir->get_key = get_key_haup; 337 ir->get_key = get_key_haup;