Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
[pandora-kernel.git] / drivers / media / video / cx88 / cx88-cards.c
index 7199169..6214eb8 100644 (file)
@@ -114,7 +114,7 @@ struct cx88_board cx88_boards[] = {
                .radio = {
                         .type  = CX88_RADIO,
                         .gpio0 = 0xff10,
-                },
+               },
        },
        [CX88_BOARD_ATI_WONDER_PRO] = {
                .name           = "ATI TV Wonder Pro",
@@ -267,7 +267,7 @@ struct cx88_board cx88_boards[] = {
                        .gpio1  = 0x00007004,
                        .gpio2  = 0x0035d700,
                        .gpio3  = 0x02000000,
-                },
+               },
        },
        [CX88_BOARD_LEADTEK_PVR2000] = {
                // gpio values for PAL version from regspy by DScaler
@@ -413,7 +413,7 @@ struct cx88_board cx88_boards[] = {
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0x000027df,
-                },{
+               },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0x000027df,
@@ -536,7 +536,7 @@ struct cx88_board cx88_boards[] = {
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0x000027df,
-                },{
+               },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0x000027df,
@@ -1041,20 +1041,16 @@ struct cx88_board cx88_boards[] = {
                .input          = {{
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
-                       .gpio0  = 0x000027df,
+                       .gpio0  = 0x000067df,
                 },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
-                       .gpio0  = 0x000027df,
+                       .gpio0  = 0x000067df,
                }},
                .dvb            = 1,
        },
        [CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = {
-               /* FIXME: Standard video using the cx88 broadcast decoder is
-                * working, but blackbird isn't working yet, audio is only
-                * working correctly for television mode. S-Video and Composite
-                * are working for video-only, so I have them disabled for now.
-                */
+               /* FIXME: Audio not working for s-video / composite inputs. */
                .name           = "KWorld HardwareMpegTV XPert",
                .tuner_type     = TUNER_PHILIPS_TDA8290,
                .radio_type     = UNSET,
@@ -1065,6 +1061,14 @@ struct cx88_board cx88_boards[] = {
                        .vmux   = 0,
                        .gpio0  = 0x3de2,
                        .gpio2  = 0x00ff,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0x3de6,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0x3de6,
                }},
                .radio = {
                        .type   = CX88_RADIO,
@@ -1132,6 +1136,173 @@ struct cx88_board cx88_boards[] = {
                }},
                .blackbird = 1,
        },
+       [CX88_BOARD_PIXELVIEW_PLAYTV_P7000] = {
+               /* FIXME: SVideo, Composite and FM inputs are untested */
+               .name           = "PixelView PlayTV P7000",
+               .tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
+                                 TDA9887_PORT2_ACTIVE,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0x5da6,
+               }},
+               .blackbird = 1,
+       },
+       [CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
+               .name           = "NPG Tech Real TV FM Top 10",
+               .tuner_type     = TUNER_TNF_5335MF, /* Actually a TNF9535 */
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0x0788,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0x078b,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0x078b,
+               }},
+               .radio = {
+                        .type  = CX88_RADIO,
+                        .gpio0 = 0x074a,
+               },
+       },
+       [CX88_BOARD_WINFAST_DTV2000H] = {
+               /* video inputs and radio still in testing */
+               .name           = "WinFast DTV2000 H",
+               .tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0x00017304,
+                       .gpio1  = 0x00008203,
+                       .gpio2  = 0x00017304,
+                       .gpio3  = 0x02000000,
+               }},
+               .dvb            = 1,
+       },
+       [CX88_BOARD_GENIATECH_DVBS] = {
+               .name          = "Geniatech DVB-S",
+               .tuner_type    = TUNER_ABSENT,
+               .radio_type    = UNSET,
+               .tuner_addr    = ADDR_UNSET,
+               .radio_addr    = ADDR_UNSET,
+               .input  = {{
+                       .type  = CX88_VMUX_DVB,
+                       .vmux  = 0,
+               },{
+                       .type  = CX88_VMUX_COMPOSITE1,
+                       .vmux  = 1,
+               }},
+               .dvb      = 1,
+       },
+       [CX88_BOARD_HAUPPAUGE_HVR3000] = {
+               /* FIXME: Add dvb & radio support */
+               .name           = "Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T",
+               .tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0x84bf,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0x84bf,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0x84bf,
+               }},
+       },
+       [CX88_BOARD_NORWOOD_MICRO] = {
+               .name           = "Norwood Micro TV Tuner",
+               .tuner_type     = TUNER_TNF_5335MF,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0x0709,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0x070b,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0x070b,
+               }},
+       },
+       [CX88_BOARD_TE_DTV_250_OEM_SWANN] = {
+              .name           = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM",
+              .tuner_type     = TUNER_LG_PAL_NEW_TAPC,
+              .radio_type     = UNSET,
+              .tuner_addr     = ADDR_UNSET,
+              .radio_addr     = ADDR_UNSET,
+              .input          = {{
+                      .type   = CX88_VMUX_TELEVISION,
+                      .vmux   = 0,
+                      .gpio0  = 0x003fffff,
+                      .gpio1  = 0x00e00000,
+                      .gpio2  = 0x003fffff,
+                      .gpio3  = 0x02000000,
+              },{
+                      .type   = CX88_VMUX_COMPOSITE1,
+                      .vmux   = 1,
+                      .gpio0  = 0x003fffff,
+                      .gpio1  = 0x00e00000,
+                      .gpio2  = 0x003fffff,
+                      .gpio3  = 0x02000000,
+               },{
+                      .type   = CX88_VMUX_SVIDEO,
+                      .vmux   = 2,
+                      .gpio0  = 0x003fffff,
+                      .gpio1  = 0x00e00000,
+                      .gpio2  = 0x003fffff,
+                      .gpio3  = 0x02000000,
+              }},
+       },
+       [CX88_BOARD_HAUPPAUGE_HVR1300] = {
+               .name           = "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder",
+               .tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT,
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0xe780,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0xe780,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0xe780,
+               }},
+               /* fixme: Add radio support */
+               .dvb            = 1,
+       },
 };
 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
 
@@ -1177,7 +1348,7 @@ struct cx88_subid cx88_subids[] = {
                .card      = CX88_BOARD_LEADTEK_PVR2000,
        },{
                .subvendor = 0x107d,
-               .subdevice = 0x663C,
+               .subdevice = 0x663c,
                .card      = CX88_BOARD_LEADTEK_PVR2000,
        },{
                .subvendor = 0x1461,
@@ -1361,6 +1532,55 @@ struct cx88_subid cx88_subids[] = {
                .subvendor = 0x1822,
                .subdevice = 0x0019,
                .card      = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
+       },{
+               .subvendor = 0x1554,
+               .subdevice = 0x4813,
+               .card      = CX88_BOARD_PIXELVIEW_PLAYTV_P7000,
+       },{
+               .subvendor = 0x14f1,
+               .subdevice = 0x0842,
+               .card      = CX88_BOARD_NPGTECH_REALTV_TOP10FM,
+       },{
+               .subvendor = 0x107d,
+               .subdevice = 0x665e,
+               .card      = CX88_BOARD_WINFAST_DTV2000H,
+       },{
+               .subvendor = 0x18ac,
+               .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
+               .card      = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
+       },{
+               .subvendor = 0x14f1,
+               .subdevice = 0x0084,
+               .card      = CX88_BOARD_GENIATECH_DVBS,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x1404,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR3000,
+       },{
+               .subvendor = 0x1461,
+               .subdevice = 0xc111, /* AverMedia M150-D */
+               /* This board is known to work with the ASUS PVR416 config */
+               .card      = CX88_BOARD_ASUS_PVR_416,
+       },{
+               .subvendor = 0xc180,
+               .subdevice = 0xc980,
+               .card      = CX88_BOARD_TE_DTV_250_OEM_SWANN,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x9600,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR1300,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x9601,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR1300,
+       },{
+               .subvendor = 0x0070,
+               .subdevice = 0x9602,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR1300,
+       },{
+               .subvendor = 0x107d,
+               .subdevice = 0x6632,
+               .card      = CX88_BOARD_LEADTEK_PVR2000,
        },
 };
 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1404,6 +1624,7 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
        /* Make sure we support the board model */
        switch (tv.model)
        {
+       case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
        case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
        case 34519: /* WinTV-PCI-FM */
        case 90002: /* Nova-T-PCI (9002) */
@@ -1415,6 +1636,11 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
        case 92000: /* Nova-SE2 (OEM, No Video or IR) */
        case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
        case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
+       case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
+       case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
+       case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
+       case 96569: /* WinTV-HVR1300 () */
+       case 96659: /* WinTV-HVR1300 () */
        case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
                /* known */
                break;
@@ -1541,6 +1767,22 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
                       core->name, i, cx88_boards[i].name);
 }
 
+void cx88_card_setup_pre_i2c(struct cx88_core *core)
+{
+       switch (core->board) {
+       case CX88_BOARD_HAUPPAUGE_HVR1300:
+               /* Bring the 702 demod up before i2c scanning/attach or devices are hidden */
+               /* We leave here with the 702 on the bus */
+               cx_write(MO_GP0_IO, 0x0000e780);
+               udelay(1000);
+               cx_clear(MO_GP0_IO, 0x00000080);
+               udelay(50);
+               cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
+               udelay(1000);
+               break;
+       }
+}
+
 void cx88_card_setup(struct cx88_core *core)
 {
        static u8 eeprom[256];
@@ -1569,6 +1811,8 @@ void cx88_card_setup(struct cx88_core *core)
        case CX88_BOARD_HAUPPAUGE_DVB_T1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR1100LP:
+       case CX88_BOARD_HAUPPAUGE_HVR3000:
+       case CX88_BOARD_HAUPPAUGE_HVR1300:
                if (0 == core->i2c_rc)
                        hauppauge_eeprom(core,eeprom);
                break;
@@ -1576,9 +1820,15 @@ void cx88_card_setup(struct cx88_core *core)
                cx_write(MO_GP0_IO, 0x000007f8);
                cx_write(MO_GP1_IO, 0x00000001);
                break;
+       case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
+               /* GPIO0:6 is hooked to FX2 reset pin */
+               cx_set(MO_GP0_IO, 0x00004040);
+               cx_clear(MO_GP0_IO, 0x00000040);
+               msleep(1000);
+               cx_set(MO_GP0_IO, 0x00004040);
+               /* FALLTHROUGH */
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
-       case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
                /* GPIO0:0 is hooked to mt352 reset pin */
                cx_set(MO_GP0_IO, 0x00000101);
@@ -1622,11 +1872,6 @@ void cx88_card_setup(struct cx88_core *core)
 /* ------------------------------------------------------------------ */
 
 EXPORT_SYMBOL(cx88_boards);
-EXPORT_SYMBOL(cx88_bcount);
-EXPORT_SYMBOL(cx88_subids);
-EXPORT_SYMBOL(cx88_idcount);
-EXPORT_SYMBOL(cx88_card_list);
-EXPORT_SYMBOL(cx88_card_setup);
 
 /*
  * Local variables: