V4L/DVB (7020): Add USB ID for a newer variant of Hauppauge WinTV USB2
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / media / video / em28xx / em28xx-cards.c
index 78be0dc257203398d80ed31ff152bd8b54b1dee2..fe0ee4518479f9f678f792d4cb9ba3bb4af1c9f5 100644 (file)
@@ -174,13 +174,14 @@ struct em28xx_board em28xx_boards[] = {
                } },
        },
        [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
-               .name         = "Hauppauge WinTV HVR 950",
-               .vchannels    = 3,
-               .tda9887_conf = TDA9887_PRESENT,
-               .tuner_type   = TUNER_XC2028,
-               .has_tuner    = 1,
-               .mts_firmware = 1,
-               .decoder      = EM28XX_TVP5150,
+               .name           = "Hauppauge WinTV HVR 950",
+               .vchannels      = 3,
+               .tda9887_conf   = TDA9887_PRESENT,
+               .tuner_type     = TUNER_XC2028,
+               .has_tuner      = 1,
+               .mts_firmware   = 1,
+               .has_12mhz_i2s  = 1,
+               .decoder        = EM28XX_TVP5150,
                .input          = { {
                        .type     = EM28XX_VMUX_TELEVISION,
                        .vmux     = TVP5150_COMPOSITE0,
@@ -418,6 +419,8 @@ struct usb_device_id em28xx_id_table [] = {
                        .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
        { USB_DEVICE(0x2040, 0x4200),
                        .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
+       { USB_DEVICE(0x2040, 0x4201),
+                       .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
        { USB_DEVICE(0x2304, 0x0207),
                        .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
        { USB_DEVICE(0x2304, 0x021a),
@@ -484,27 +487,31 @@ static int em28xx_tuner_callback(void *ptr, int command, int arg)
        switch (command) {
        case XC2028_TUNER_RESET:
        {
-               char gpio0, gpio1, gpio4;
-
-               /* GPIO and initialization codes for analog TV */
-               gpio0 = dev->analog_gpio & 0xff;
-               gpio1 = (dev->analog_gpio >> 8) & 0xff;
-               gpio4 = dev->analog_gpio >> 24;
+               /* GPIO and initialization codes for analog TV and radio
+                  This code should be complemented for DTV, since reset
+                  codes are different.
+                */
 
                dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1);
                dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1);
 
-               if (gpio4) {
-                       dev->em28xx_write_regs(dev, 0x04, &gpio4, 1);
-                       msleep(140);
+               if (dev->analog_gpio) {
+                       char gpio0 = dev->analog_gpio & 0xff;
+                       char gpio1 = (dev->analog_gpio >> 8) & 0xff;
+                       char gpio4 = dev->analog_gpio >> 24;
+
+                       if (gpio4) {
+                               dev->em28xx_write_regs(dev, 0x04, &gpio4, 1);
+                               msleep(140);
+                       }
+
+                       msleep(6);
+                       dev->em28xx_write_regs(dev, 0x08, &gpio0, 1);
+                       msleep(10);
+                       dev->em28xx_write_regs(dev, 0x08, &gpio1, 1);
+                       msleep(5);
                }
 
-               msleep(6);
-               dev->em28xx_write_regs(dev, 0x08, &gpio0, 1);
-               msleep(10);
-               dev->em28xx_write_regs(dev, 0x08, &gpio1, 1);
-               msleep(5);
-
                break;
        }
        }
@@ -641,6 +648,7 @@ static void em28xx_set_model(struct em28xx *dev)
        dev->decoder = em28xx_boards[dev->model].decoder;
        dev->video_inputs = em28xx_boards[dev->model].vchannels;
        dev->analog_gpio = em28xx_boards[dev->model].analog_gpio;
+       dev->has_12mhz_i2s = em28xx_boards[dev->model].has_12mhz_i2s;
 
        if (!em28xx_boards[dev->model].has_tuner)
                dev->tuner_type = UNSET;
@@ -676,10 +684,6 @@ void em28xx_card_setup(struct em28xx *dev)
                if (tv.has_ir)
                        request_module("ir-kbd-i2c");
 #endif
-               /* enable audio 12 mhz i2s */
-               em28xx_write_regs(dev, XCLK_REG, "\xa7", 1);
-               msleep(10);
-
                break;
        }
        case EM2820_BOARD_KWORLD_PVRTV2800RF: