]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cx88/cx88-cards.c
Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-omap-h63xx.git] / drivers / media / video / cx88 / cx88-cards.c
index 9f721080152468d420fc501fa6be98451b633350..5bcbb4cc7c2a53e0656d56be53441ad085fb0874 100644 (file)
@@ -1270,27 +1270,40 @@ static const struct cx88_board cx88_boards[] = {
                .mpeg           = CX88_MPEG_DVB,
        },
        [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,
+               .audio_chip     = V4L2_IDENT_WM8775,
                .input          = {{
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
                        .gpio0  = 0x84bf,
+                       /* 1: TV Audio / FM Mono */
+                       .audioroute = 1,
                },{
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0x84bf,
+                       /* 2: Line-In */
+                       .audioroute = 2,
                },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0x84bf,
+                       /* 2: Line-In */
+                       .audioroute = 2,
                }},
+               .radio = {
+                       .type   = CX88_RADIO,
+                       .gpio0  = 0x84bf,
+                       /* 4: FM Stereo (untested) */
+                       .audioroute = 8,
+               },
                .mpeg           = CX88_MPEG_DVB,
+               .num_frontends  = 2,
        },
        [CX88_BOARD_NORWOOD_MICRO] = {
                .name           = "Norwood Micro TV Tuner",
@@ -1356,23 +1369,27 @@ static const struct cx88_board cx88_boards[] = {
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
                        .gpio0  = 0xef88,
+                       /* 1: TV Audio / FM Mono */
                        .audioroute = 1,
                },{
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0xef88,
+                       /* 2: Line-In */
                        .audioroute = 2,
                },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0xef88,
+                       /* 2: Line-In */
                        .audioroute = 2,
                }},
-               /* fixme: Add radio support */
                .mpeg           = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
                .radio = {
                        .type   = CX88_RADIO,
                        .gpio0  = 0xef88,
+                       /* 4: FM Stereo (untested) */
+                       .audioroute = 8,
                },
        },
        [CX88_BOARD_ADSTECH_PTV_390] = {
@@ -1449,15 +1466,26 @@ static const struct cx88_board cx88_boards[] = {
                .name           = "Pinnacle Hybrid PCTV",
                .tuner_type     = TUNER_XC2028,
                .tuner_addr     = 0x61,
+               .radio_type     = TUNER_XC2028,
+               .radio_addr     = 0x61,
                .input          = { {
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
+                       .gpio0  = 0x004ff,
+                       .gpio1  = 0x010ff,
+                       .gpio2  = 0x00001,
                }, {
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
+                       .gpio0  = 0x004fb,
+                       .gpio1  = 0x010ef,
+                       .audioroute = 1,
                }, {
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
+                       .gpio0  = 0x004fb,
+                       .gpio1  = 0x010ef,
+                       .audioroute = 1,
                } },
                .radio = {
                        .type   = CX88_RADIO,
@@ -1465,6 +1493,7 @@ static const struct cx88_board cx88_boards[] = {
                        .gpio1  = 0x010ff,
                        .gpio2  = 0x0ff,
                },
+               .mpeg           = CX88_MPEG_DVB,
        },
        [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = {
                .name           = "Winfast TV2000 XP Global",
@@ -1569,9 +1598,9 @@ static const struct cx88_board cx88_boards[] = {
        },
        [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = {
                .name           = "DViCO FusionHDTV DVB-T PRO",
-               .tuner_type     = TUNER_ABSENT, /* XXX: Has XC3028 */
+               .tuner_type     = TUNER_XC2028,
+               .tuner_addr     = 0x61,
                .radio_type     = UNSET,
-               .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .input          = { {
                        .type   = CX88_VMUX_COMPOSITE1,
@@ -1704,6 +1733,7 @@ static const struct cx88_board cx88_boards[] = {
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .tda9887_conf   = TDA9887_PRESENT,
+               .audio_chip     = V4L2_IDENT_WM8775,
                /*
                 * GPIO0 (WINTV2000)
                 *
@@ -1717,7 +1747,7 @@ static const struct cx88_board cx88_boards[] = {
                 * BIT  VALUE   FUNCTION GP{x}_IO
                 * 0    1       I:?
                 * 1    1       I:?
-                * 2    1       O:DVB-T DEMOD ENABLE LOW/ANALOG DEMOD ENABLE HIGH
+                * 2    1       O:MPEG PORT 0=DVB-T 1=DVB-S
                 * 3    1       I:?
                 * 4    1       I:?
                 * 5    1       I:?
@@ -1733,22 +1763,41 @@ static const struct cx88_board cx88_boards[] = {
                 * d    0       I
                 * e    1       O
                 * f    1       O
+                *
+                * WM8775 ADC
+                *
+                * 1: TV Audio / FM Mono
+                * 2: Line-In
+                * 3: Line-In Expansion
+                * 4: FM Stereo
                 */
                .input          = {{
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
                        .gpio0  = 0xc4bf,
+                       /* 1: TV Audio / FM Mono */
+                       .audioroute = 1,
                }, {
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0xc4bf,
+                       /* 2: Line-In */
+                       .audioroute = 2,
                }, {
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0xc4bf,
+                       /* 2: Line-In */
+                       .audioroute = 2,
                } },
-               /* fixme: Add radio support */
+               .radio = {
+                       .type   = CX88_RADIO,
+                       .gpio0  = 0xc4bf,
+                       /* 4: FM Stereo */
+                       .audioroute = 8,
+               },
                .mpeg           = CX88_MPEG_DVB,
+               .num_frontends  = 2,
        },
        [CX88_BOARD_HAUPPAUGE_HVR4000LITE] = {
                .name           = "Hauppauge WinTV-HVR4000(Lite) DVB-S/S2",
@@ -1810,6 +1859,18 @@ static const struct cx88_board cx88_boards[] = {
                } },
                .mpeg           = CX88_MPEG_DVB,
        },
+       [CX88_BOARD_PROF_7300] = {
+               .name           = "PROF 7300 DVB-S/S2",
+               .tuner_type     = UNSET,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .input          = {{
+                       .type   = CX88_VMUX_DVB,
+                       .vmux   = 0,
+               } },
+               .mpeg           = CX88_MPEG_DVB,
+       },
 };
 
 /* ------------------------------------------------------------------ */
@@ -2199,6 +2260,10 @@ static const struct cx88_subid cx88_subids[] = {
                .subvendor = 0x8920,
                .subdevice = 0x8888,
                .card      = CX88_BOARD_TBS_8920,
+       }, {
+               .subvendor = 0xB033,
+               .subdevice = 0x3033,
+               .card      = CX88_BOARD_PROF_7300,
        },
 };
 
@@ -2634,10 +2699,13 @@ static void cx88_card_setup_pre_i2c(struct cx88_core *core)
 
        case CX88_BOARD_HAUPPAUGE_HVR3000:
        case CX88_BOARD_HAUPPAUGE_HVR4000:
-       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
                /* Init GPIO */
                cx_write(MO_GP0_IO, core->board.input[0].gpio0);
                udelay(1000);
+               cx_clear(MO_GP0_IO, 0x00000080);
+               udelay(50);
+               cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
+               udelay(1000);
                break;
        }
 }
@@ -2659,7 +2727,7 @@ void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
                        core->i2c_algo.udelay = 16;
                break;
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
-               ctl->scode_table = XC3028_FE_ZARLINK456;
+               ctl->demod = XC3028_FE_ZARLINK456;
                break;
        case CX88_BOARD_KWORLD_ATSC_120:
        case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
@@ -2671,6 +2739,10 @@ void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
                 * Those boards uses non-MTS firmware
                 */
                break;
+       case CX88_BOARD_PINNACLE_HYBRID_PCTV:
+               ctl->demod = XC3028_FE_ZARLINK456;
+               ctl->mts = 1;
+               break;
        default:
                ctl->demod = XC3028_FE_OREN538;
                ctl->mts = 1;
@@ -2801,18 +2873,9 @@ static void cx88_card_setup(struct cx88_core *core)
        }
        case  CX88_BOARD_TEVII_S420:
        case  CX88_BOARD_TEVII_S460:
-               cx_write(MO_SRST_IO, 0);
-               msleep(100);
-               cx_write(MO_SRST_IO, 1);
-               msleep(100);
-               break;
        case  CX88_BOARD_OMICOM_SS4_PCI:
-               cx_write(MO_SRST_IO, 0);
-               msleep(100);
-               cx_write(MO_SRST_IO, 1);
-               msleep(100);
-               break;
        case  CX88_BOARD_TBS_8920:
+       case  CX88_BOARD_PROF_7300:
                cx_write(MO_SRST_IO, 0);
                msleep(100);
                cx_write(MO_SRST_IO, 1);
@@ -2981,10 +3044,14 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
 
        memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
 
-       info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
+       if (!core->board.num_frontends && (core->board.mpeg & CX88_MPEG_DVB))
+               core->board.num_frontends = 1;
+
+       info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s], frontend(s): %d\n",
                pci->subsystem_vendor, pci->subsystem_device, core->board.name,
                core->boardnr, card[core->nr] == core->boardnr ?
-               "insmod option" : "autodetected");
+               "insmod option" : "autodetected",
+               core->board.num_frontends);
 
        if (tuner[core->nr] != UNSET)
                core->board.tuner_type = tuner[core->nr];