V4L/DVB (6021): cx88: Copy board information into card state
[deliverable/linux.git] / drivers / media / video / cx88 / cx88-cards.c
index e61102dc8ad7fc154244ffe3044ec1df217d152e..8be90ad4e91027907c65db1c89757c3c7f7a7bbd 100644 (file)
@@ -30,7 +30,7 @@
 /* ------------------------------------------------------------------ */
 /* board config info                                                  */
 
-struct cx88_board cx88_boards[] = {
+const struct cx88_board cx88_boards[] = {
        [CX88_BOARD_UNKNOWN] = {
                .name           = "UNKNOWN/GENERIC",
                .tuner_type     = UNSET,
@@ -575,35 +575,34 @@ struct cx88_board cx88_boards[] = {
                .tuner_addr     = ADDR_UNSET,
                .radio_addr     = ADDR_UNSET,
                .tda9887_conf   = TDA9887_PRESENT,
+               /* GPIO[2] = audio source for analog audio out connector
+                *  0 = analog audio input connector
+                *  1 = CX88 audio DACs
+                *
+                * GPIO[7] = input to CX88's audio/chroma ADC
+                *  0 = FM 10.7 MHz IF
+                *  1 = Sound 4.5 MHz IF
+                *
+                * GPIO[1,5,6] = Oren 51132 pins 27,35,28 respectively
+                *
+                * GPIO[16] = Remote control input
+                */
                .input          = {{
                        .type   = CX88_VMUX_TELEVISION,
                        .vmux   = 0,
                        .gpio0  = 0x00008484,
-                       .gpio1  = 0x00000000,
-                       .gpio2  = 0x00000000,
-                       .gpio3  = 0x00000000,
                },{
                        .type   = CX88_VMUX_COMPOSITE1,
                        .vmux   = 1,
                        .gpio0  = 0x00008400,
-                       .gpio1  = 0x00000000,
-                       .gpio2  = 0x00000000,
-                       .gpio3  = 0x00000000,
                },{
                        .type   = CX88_VMUX_SVIDEO,
                        .vmux   = 2,
                        .gpio0  = 0x00008400,
-                       .gpio1  = 0x00000000,
-                       .gpio2  = 0x00000000,
-                       .gpio3  = 0x00000000,
                }},
                .radio = {
                        .type   = CX88_RADIO,
-                       .vmux   = 2,
-                       .gpio0  = 0x00008400,
-                       .gpio1  = 0x00000000,
-                       .gpio2  = 0x00000000,
-                       .gpio3  = 0x00000000,
+                       .gpio0  = 0x00008404,
                },
                .mpeg           = CX88_MPEG_DVB,
        },
@@ -1335,6 +1334,26 @@ struct cx88_board cx88_boards[] = {
                /* fixme: Add radio support */
                .mpeg           = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
        },
+       [CX88_BOARD_ADSTECH_PTV_390] = {
+               .name           = "ADS Tech Instant Video PCI",
+               .tuner_type     = TUNER_ABSENT,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .input          = {{
+                       .type   = CX88_VMUX_DEBUG,
+                       .vmux   = 3,
+                       .gpio0  = 0x04ff,
+               },{
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0x07fa,
+               },{
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0x07fa,
+               }},
+       },
 };
 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
 
@@ -1641,6 +1660,10 @@ struct cx88_subid cx88_subids[] = {
                .subvendor = 0x1421,
                .subdevice = 0x0341, /* ADS Tech InstantTV DVB-S */
                .card      = CX88_BOARD_KWORLD_DVBS_100,
+       },{
+               .subvendor = 0x1421,
+               .subdevice = 0x0390,
+               .card      = CX88_BOARD_ADSTECH_PTV_390,
        },
 };
 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1664,12 +1687,12 @@ static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
                return;
        }
 
-       core->has_radio  = 1;
-       core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
+       core->board.tuner_type = (eeprom_data[6] == 0x13) ?
+               TUNER_PHILIPS_FM1236_MK3 : TUNER_PHILIPS_FM1216ME_MK3;
 
        printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
               "tuner=%d, eeprom[0]=0x%02x\n",
-              core->name, core->tuner_type, eeprom_data[0]);
+              core->name, core->board.tuner_type, eeprom_data[0]);
 }
 
 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
@@ -1677,9 +1700,9 @@ static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
        struct tveeprom tv;
 
        tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
-       core->tuner_type = tv.tuner_type;
+       core->board.tuner_type = tv.tuner_type;
        core->tuner_formats = tv.tuner_formats;
-       core->has_radio  = tv.has_radio;
+       core->board.radio.type = tv.has_radio ? CX88_RADIO : 0;
 
        /* Make sure we support the board model */
        switch (tv.model)
@@ -1769,8 +1792,9 @@ static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
               name ? name : "unknown");
        if (NULL == name)
                return;
-       core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
-       core->has_radio  = gdi_tuner[eeprom_data[0x0d]].fm;
+       core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
+       core->board.radio.type = gdi_tuner[eeprom_data[0x0d]].fm ?
+               CX88_RADIO : 0;
 }
 
 /* ----------------------------------------------------------------------- */
@@ -1837,7 +1861,7 @@ void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
 
 void cx88_card_setup_pre_i2c(struct cx88_core *core)
 {
-       switch (core->board) {
+       switch (core->boardnr) {
        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 */
@@ -1860,7 +1884,7 @@ void cx88_card_setup(struct cx88_core *core)
                tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
        }
 
-       switch (core->board) {
+       switch (core->boardnr) {
        case CX88_BOARD_HAUPPAUGE:
        case CX88_BOARD_HAUPPAUGE_ROSLYN:
                if (0 == core->i2c_rc)
@@ -1904,7 +1928,7 @@ void cx88_card_setup(struct cx88_core *core)
                msleep(1);
                cx_set(MO_GP0_IO, 0x00000101);
                if (0 == core->i2c_rc &&
-                   core->board == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
+                   core->boardnr == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
                        dvico_fusionhdtv_hybrid_init(core);
                break;
        case CX88_BOARD_KWORLD_DVB_T:
@@ -1942,14 +1966,10 @@ void cx88_card_setup(struct cx88_core *core)
                }
                break;
        }
-       if (cx88_boards[core->board].radio.type == CX88_RADIO)
-               core->has_radio = 1;
 }
 
 /* ------------------------------------------------------------------ */
 
-EXPORT_SYMBOL(cx88_boards);
-
 /*
  * Local variables:
  * c-basic-offset: 8
This page took 0.029862 seconds and 5 git commands to generate.