aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-12-07 11:19:29 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:17 -0500
commit26d5f3a3fe917232cb77e2e3450f7d7f8698259c (patch)
tree48199cf712ebead3c717bae21b4b75b32f3a40ce
parent10f201af1bedd39a88913f472b33698c4a3b0680 (diff)
V4L/DVB (9772): saa7134: Add support for Kworld Plus TV Analog Lite PCI
Thanks to Sistema Fenix (http://www.sistemafenix.com.br/) for sponsoring this development. Signed-off-by: Gilberto <gilberto@sistemafenix.com.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/video4linux/CARDLIST.saa71341
-rw-r--r--drivers/media/common/ir-keymaps.c61
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c44
-rw-r--r--drivers/media/video/saa7134/saa7134-input.c14
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
-rw-r--r--include/media/ir-common.h1
6 files changed, 122 insertions, 0 deletions
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
index dc67eef38ff9..dd979dca8af6 100644
--- a/Documentation/video4linux/CARDLIST.saa7134
+++ b/Documentation/video4linux/CARDLIST.saa7134
@@ -151,3 +151,4 @@
151150 -> Zogis Real Angel 220 151150 -> Zogis Real Angel 220
152151 -> ADS Tech Instant HDTV [1421:0380] 152151 -> ADS Tech Instant HDTV [1421:0380]
153152 -> Asus Tiger Rev:1.00 [1043:4857] 153152 -> Asus Tiger Rev:1.00 [1043:4857]
154153 -> Kworld Plus TV Analog Lite PCI [17de:7128]
diff --git a/drivers/media/common/ir-keymaps.c b/drivers/media/common/ir-keymaps.c
index 3534cdc1f953..d8229a0e9a9c 100644
--- a/drivers/media/common/ir-keymaps.c
+++ b/drivers/media/common/ir-keymaps.c
@@ -2391,6 +2391,67 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = {
2391}; 2391};
2392EXPORT_SYMBOL_GPL(ir_codes_powercolor_real_angel); 2392EXPORT_SYMBOL_GPL(ir_codes_powercolor_real_angel);
2393 2393
2394/* Kworld Plus TV Analog Lite PCI IR
2395 Mauro Carvalho Chehab <mchehab@infradead.org>
2396 */
2397IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE] = {
2398 [0x0c] = KEY_PROG1, /* Kworld key */
2399 [0x16] = KEY_CLOSECD, /* -> ) */
2400 [0x1d] = KEY_POWER2,
2401
2402 [0x00] = KEY_1,
2403 [0x01] = KEY_2,
2404 [0x02] = KEY_3, /* Two keys have the same code: 3 and left */
2405 [0x03] = KEY_4, /* Two keys have the same code: 3 and right */
2406 [0x04] = KEY_5,
2407 [0x05] = KEY_6,
2408 [0x06] = KEY_7,
2409 [0x07] = KEY_8,
2410 [0x08] = KEY_9,
2411 [0x0a] = KEY_0,
2412
2413 [0x09] = KEY_AGAIN,
2414 [0x14] = KEY_MUTE,
2415
2416 [0x20] = KEY_UP,
2417 [0x21] = KEY_DOWN,
2418 [0x0b] = KEY_ENTER,
2419
2420 [0x10] = KEY_CHANNELUP,
2421 [0x11] = KEY_CHANNELDOWN,
2422
2423 /* Couldn't map key left/key right since those
2424 conflict with '3' and '4' scancodes
2425 I dunno what the original driver does
2426 */
2427
2428 [0x13] = KEY_VOLUMEUP,
2429 [0x12] = KEY_VOLUMEDOWN,
2430
2431 /* The lower part of the IR
2432 There are several duplicated keycodes there.
2433 Most of them conflict with digits.
2434 Add mappings just to the unused scancodes.
2435 Somehow, the original driver has a way to know,
2436 but this doesn't seem to be on some GPIO.
2437 Also, it is not related to the time between keyup
2438 and keydown.
2439 */
2440 [0x19] = KEY_PAUSE, /* Timeshift */
2441 [0x1a] = KEY_STOP,
2442 [0x1b] = KEY_RECORD,
2443
2444 [0x22] = KEY_TEXT,
2445
2446 [0x15] = KEY_AUDIO, /* ((*)) */
2447 [0x0f] = KEY_ZOOM,
2448 [0x1c] = KEY_SHUFFLE, /* snapshot */
2449
2450 [0x18] = KEY_RED, /* B */
2451 [0x23] = KEY_GREEN, /* C */
2452};
2453EXPORT_SYMBOL_GPL(ir_codes_kworld_plus_tv_analog);
2454
2394IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE] = { 2455IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE] = {
2395 [0x20] = KEY_LIST, 2456 [0x20] = KEY_LIST,
2396 [0x00] = KEY_POWER, 2457 [0x00] = KEY_POWER,
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 863522899e85..f0b95804e414 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -4606,6 +4606,43 @@ struct saa7134_board saa7134_boards[] = {
4606 .gpio = 0x0200000, 4606 .gpio = 0x0200000,
4607 }, 4607 },
4608 }, 4608 },
4609 [SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG] = {
4610 .name = "Kworld Plus TV Analog Lite PCI",
4611 .audio_clock = 0x00187de7,
4612 .tuner_type = TUNER_YMEC_TVF_5533MF,
4613 .radio_type = TUNER_TEA5767,
4614 .tuner_addr = ADDR_UNSET,
4615 .radio_addr = ADDR_UNSET,
4616 .gpiomask = 0x80000700,
4617 .inputs = { {
4618 .name = name_tv,
4619 .vmux = 1,
4620 .amux = LINE2,
4621 .tv = 1,
4622 .gpio = 0x100,
4623 }, {
4624 .name = name_comp1,
4625 .vmux = 3,
4626 .amux = LINE1,
4627 .gpio = 0x200,
4628 }, {
4629 .name = name_svideo,
4630 .vmux = 8,
4631 .amux = LINE1,
4632 .gpio = 0x200,
4633 } },
4634 .radio = {
4635 .name = name_radio,
4636 .vmux = 1,
4637 .amux = LINE1,
4638 .gpio = 0x100,
4639 },
4640 .mute = {
4641 .name = name_mute,
4642 .vmux = 8,
4643 .amux = 2,
4644 },
4645 },
4609}; 4646};
4610 4647
4611const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); 4648const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -5653,6 +5690,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
5653 .subdevice = 0x4878, /* REV:1.02G */ 5690 .subdevice = 0x4878, /* REV:1.02G */
5654 .driver_data = SAA7134_BOARD_ASUSTeK_TIGER_3IN1, 5691 .driver_data = SAA7134_BOARD_ASUSTeK_TIGER_3IN1,
5655 }, { 5692 }, {
5693 .vendor = PCI_VENDOR_ID_PHILIPS,
5694 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
5695 .subvendor = 0x17de,
5696 .subdevice = 0x7128,
5697 .driver_data = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG,
5698 }, {
5656 /* --- boards without eeprom + subsystem ID --- */ 5699 /* --- boards without eeprom + subsystem ID --- */
5657 .vendor = PCI_VENDOR_ID_PHILIPS, 5700 .vendor = PCI_VENDOR_ID_PHILIPS,
5658 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 5701 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
@@ -5880,6 +5923,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
5880 case SAA7134_BOARD_BEHOLD_507_9FM: 5923 case SAA7134_BOARD_BEHOLD_507_9FM:
5881 case SAA7134_BOARD_GENIUS_TVGO_A11MCE: 5924 case SAA7134_BOARD_GENIUS_TVGO_A11MCE:
5882 case SAA7134_BOARD_REAL_ANGEL_220: 5925 case SAA7134_BOARD_REAL_ANGEL_220:
5926 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
5883 dev->has_remote = SAA7134_REMOTE_GPIO; 5927 dev->has_remote = SAA7134_REMOTE_GPIO;
5884 break; 5928 break;
5885 case SAA7134_BOARD_FLYDVBS_LR300: 5929 case SAA7134_BOARD_FLYDVBS_LR300:
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index c53fd5f9f6b5..d2124f64e4e2 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -97,6 +97,15 @@ static int build_key(struct saa7134_dev *dev)
97 dprintk("build_key gpio=0x%x mask=0x%x data=%d\n", 97 dprintk("build_key gpio=0x%x mask=0x%x data=%d\n",
98 gpio, ir->mask_keycode, data); 98 gpio, ir->mask_keycode, data);
99 99
100 switch (dev->board) {
101 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
102 if (data == ir->mask_keycode)
103 ir_input_nokey(ir->dev, &ir->ir);
104 else
105 ir_input_keydown(ir->dev, &ir->ir, data, data);
106 return 0;
107 }
108
100 if (ir->polling) { 109 if (ir->polling) {
101 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || 110 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
102 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { 111 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
@@ -586,6 +595,11 @@ int saa7134_input_init1(struct saa7134_dev *dev)
586 mask_keyup = 0x4000; 595 mask_keyup = 0x4000;
587 polling = 50; /* ms */ 596 polling = 50; /* ms */
588 break; 597 break;
598 case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
599 ir_codes = ir_codes_kworld_plus_tv_analog;
600 mask_keycode = 0x7f;
601 polling = 40; /* ms */
602 break;
589 } 603 }
590 if (NULL == ir_codes) { 604 if (NULL == ir_codes) {
591 printk("%s: Oops: IR config error [card=%d]\n", 605 printk("%s: Oops: IR config error [card=%d]\n",
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 9070efe4a4d0..f6c1fcc72070 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -275,6 +275,7 @@ struct saa7134_format {
275#define SAA7134_BOARD_REAL_ANGEL_220 150 275#define SAA7134_BOARD_REAL_ANGEL_220 150
276#define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI 151 276#define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI 151
277#define SAA7134_BOARD_ASUSTeK_TIGER 152 277#define SAA7134_BOARD_ASUSTeK_TIGER 152
278#define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG 153
278 279
279#define SAA7134_MAXBOARDS 32 280#define SAA7134_MAXBOARDS 32
280#define SAA7134_INPUT_MAX 8 281#define SAA7134_INPUT_MAX 8
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 3a88e13a20e9..5bf2ea00678c 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -158,6 +158,7 @@ extern IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE];
158extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE]; 158extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE];
159extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE]; 159extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE];
160extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE]; 160extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE];
161extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
161#endif 162#endif
162 163
163/* 164/*