V4L/DVB (9772): saa7134: Add support for Kworld Plus TV Analog Lite PCI
authorMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 7 Dec 2008 16:19:29 +0000 (13:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:38:17 +0000 (09:38 -0200)
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>
Documentation/video4linux/CARDLIST.saa7134
drivers/media/common/ir-keymaps.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134.h
include/media/ir-common.h

index dc67eef38ff92071995b9c0d12f901ef4e3837b9..dd979dca8af6233f1beff9a3d3b5c41aaa8f61e0 100644 (file)
 150 -> Zogis Real Angel 220
 151 -> ADS Tech Instant HDTV                    [1421:0380]
 152 -> Asus Tiger Rev:1.00                      [1043:4857]
+153 -> Kworld Plus TV Analog Lite PCI           [17de:7128]
index 3534cdc1f953870d0ad39f7b2168beaddcc9a86b..d8229a0e9a9c4754603bb8cf0bfefd05e72ad36e 100644 (file)
@@ -2391,6 +2391,67 @@ IR_KEYTAB_TYPE ir_codes_powercolor_real_angel[IR_KEYTAB_SIZE] = {
 };
 EXPORT_SYMBOL_GPL(ir_codes_powercolor_real_angel);
 
+/* Kworld Plus TV Analog Lite PCI IR
+   Mauro Carvalho Chehab <mchehab@infradead.org>
+ */
+IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE] = {
+       [0x0c] = KEY_PROG1,             /* Kworld key */
+       [0x16] = KEY_CLOSECD,           /* -> ) */
+       [0x1d] = KEY_POWER2,
+
+       [0x00] = KEY_1,
+       [0x01] = KEY_2,
+       [0x02] = KEY_3,                 /* Two keys have the same code: 3 and left */
+       [0x03] = KEY_4,                 /* Two keys have the same code: 3 and right */
+       [0x04] = KEY_5,
+       [0x05] = KEY_6,
+       [0x06] = KEY_7,
+       [0x07] = KEY_8,
+       [0x08] = KEY_9,
+       [0x0a] = KEY_0,
+
+       [0x09] = KEY_AGAIN,
+       [0x14] = KEY_MUTE,
+
+       [0x20] = KEY_UP,
+       [0x21] = KEY_DOWN,
+       [0x0b] = KEY_ENTER,
+
+       [0x10] = KEY_CHANNELUP,
+       [0x11] = KEY_CHANNELDOWN,
+
+       /* Couldn't map key left/key right since those
+          conflict with '3' and '4' scancodes
+          I dunno what the original driver does
+        */
+
+       [0x13] = KEY_VOLUMEUP,
+       [0x12] = KEY_VOLUMEDOWN,
+
+       /* The lower part of the IR
+          There are several duplicated keycodes there.
+          Most of them conflict with digits.
+          Add mappings just to the unused scancodes.
+          Somehow, the original driver has a way to know,
+          but this doesn't seem to be on some GPIO.
+          Also, it is not related to the time between keyup
+          and keydown.
+        */
+       [0x19] = KEY_PAUSE,             /* Timeshift */
+       [0x1a] = KEY_STOP,
+       [0x1b] = KEY_RECORD,
+
+       [0x22] = KEY_TEXT,
+
+       [0x15] = KEY_AUDIO,             /* ((*)) */
+       [0x0f] = KEY_ZOOM,
+       [0x1c] = KEY_SHUFFLE,           /* snapshot */
+
+       [0x18] = KEY_RED,               /* B */
+       [0x23] = KEY_GREEN,             /* C */
+};
+EXPORT_SYMBOL_GPL(ir_codes_kworld_plus_tv_analog);
+
 IR_KEYTAB_TYPE ir_codes_avermedia_a16d[IR_KEYTAB_SIZE] = {
        [0x20] = KEY_LIST,
        [0x00] = KEY_POWER,
index 863522899e85248a82d71cf352cb39d697a14406..f0b95804e4146afda1655315bf9f94705dd14478 100644 (file)
@@ -4606,6 +4606,43 @@ struct saa7134_board saa7134_boards[] = {
                        .gpio   = 0x0200000,
                },
        },
+       [SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG] = {
+               .name           = "Kworld Plus TV Analog Lite PCI",
+               .audio_clock    = 0x00187de7,
+               .tuner_type     = TUNER_YMEC_TVF_5533MF,
+               .radio_type     = TUNER_TEA5767,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .gpiomask       = 0x80000700,
+               .inputs = { {
+                       .name   = name_tv,
+                       .vmux   = 1,
+                       .amux   = LINE2,
+                       .tv     = 1,
+                       .gpio   = 0x100,
+               }, {
+                       .name   = name_comp1,
+                       .vmux   = 3,
+                       .amux   = LINE1,
+                       .gpio   = 0x200,
+               }, {
+                       .name   = name_svideo,
+                       .vmux   = 8,
+                       .amux   = LINE1,
+                       .gpio   = 0x200,
+               } },
+               .radio = {
+                       .name   = name_radio,
+                       .vmux   = 1,
+                       .amux   = LINE1,
+                       .gpio   = 0x100,
+               },
+               .mute = {
+                       .name = name_mute,
+                       .vmux = 8,
+                       .amux = 2,
+               },
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -5652,6 +5689,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subvendor    = 0x1043,
                .subdevice    = 0x4878, /* REV:1.02G */
                .driver_data  = SAA7134_BOARD_ASUSTeK_TIGER_3IN1,
+       }, {
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+               .subvendor    = 0x17de,
+               .subdevice    = 0x7128,
+               .driver_data  = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG,
        }, {
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -5880,6 +5923,7 @@ int saa7134_board_init1(struct saa7134_dev *dev)
        case SAA7134_BOARD_BEHOLD_507_9FM:
        case SAA7134_BOARD_GENIUS_TVGO_A11MCE:
        case SAA7134_BOARD_REAL_ANGEL_220:
+       case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
                dev->has_remote = SAA7134_REMOTE_GPIO;
                break;
        case SAA7134_BOARD_FLYDVBS_LR300:
index c53fd5f9f6b553bac073483b5c69ced28f7d6967..d2124f64e4e2339a6d140e0bc83a72b011c0c766 100644 (file)
@@ -97,6 +97,15 @@ static int build_key(struct saa7134_dev *dev)
        dprintk("build_key gpio=0x%x mask=0x%x data=%d\n",
                gpio, ir->mask_keycode, data);
 
+       switch (dev->board) {
+       case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
+               if (data == ir->mask_keycode)
+                       ir_input_nokey(ir->dev, &ir->ir);
+               else
+                       ir_input_keydown(ir->dev, &ir->ir, data, data);
+               return 0;
+       }
+
        if (ir->polling) {
                if ((ir->mask_keydown  &&  (0 != (gpio & ir->mask_keydown))) ||
                    (ir->mask_keyup    &&  (0 == (gpio & ir->mask_keyup)))) {
@@ -586,6 +595,11 @@ int saa7134_input_init1(struct saa7134_dev *dev)
                mask_keyup   = 0x4000;
                polling = 50; /* ms */
                break;
+       case SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG:
+               ir_codes     = ir_codes_kworld_plus_tv_analog;
+               mask_keycode = 0x7f;
+               polling = 40; /* ms */
+               break;
        }
        if (NULL == ir_codes) {
                printk("%s: Oops: IR config error [card=%d]\n",
index 9070efe4a4d005786a34273aa82fa67545171078..f6c1fcc720701cc04c74fe6029a0b0f3acfff942 100644 (file)
@@ -275,6 +275,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_REAL_ANGEL_220     150
 #define SAA7134_BOARD_ADS_INSTANT_HDTV_PCI  151
 #define SAA7134_BOARD_ASUSTeK_TIGER         152
+#define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG 153
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
index 3a88e13a20e92db102123d13ae81fcc9466f010a..5bf2ea00678c0c9c245c8c1826b71f516025af7e 100644 (file)
@@ -158,6 +158,7 @@ extern IR_KEYTAB_TYPE ir_codes_encore_enltv_fm53[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_real_audio_220_32_keys[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
 #endif
 
 /*