V4L/DVB (7082): support for Twinhan Hybrid DTV-DVB 3056 PCI
[deliverable/linux.git] / drivers / media / video / saa7134 / saa7134-dvb.c
index 1f6bd3300715994db922aff1b00de86f7953410a..90f495a678040819e9d0fc42e5f0140f1b745f35 100644 (file)
@@ -567,6 +567,7 @@ static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config
 }
 
 /* ------------------------------------------------------------------ */
+
 static struct tda1004x_config tda827x_lifeview_config = {
        .demod_address = 0x08,
        .invert        = 1,
@@ -661,6 +662,7 @@ static struct tda1004x_config hauppauge_hvr_1110_config = {
        .if_freq       = TDA10046_FREQ_045,
        .i2c_gate      = 0x4b,
        .tuner_address = 0x61,
+       .tuner_config  = 1,
        .request_firmware = philips_tda1004x_request_firmware
 };
 
@@ -746,6 +748,7 @@ static struct tda1004x_config asus_p7131_hybrid_lna_config = {
        .antenna_switch= 2,
        .request_firmware = philips_tda1004x_request_firmware
 };
+
 static struct tda1004x_config kworld_dvb_t_210_config = {
        .demod_address = 0x08,
        .invert        = 1,
@@ -760,6 +763,37 @@ static struct tda1004x_config kworld_dvb_t_210_config = {
        .antenna_switch= 1,
        .request_firmware = philips_tda1004x_request_firmware
 };
+
+static struct tda1004x_config avermedia_super_007_config = {
+       .demod_address = 0x08,
+       .invert        = 1,
+       .invert_oclk   = 0,
+       .xtal_freq     = TDA10046_XTAL_16M,
+       .agc_config    = TDA10046_AGC_TDA827X,
+       .gpio_config   = TDA10046_GP01_I,
+       .if_freq       = TDA10046_FREQ_045,
+       .i2c_gate      = 0x4b,
+       .tuner_address = 0x60,
+       .tuner_config  = 0,
+       .antenna_switch= 1,
+       .request_firmware = philips_tda1004x_request_firmware
+};
+
+static struct tda1004x_config twinhan_dtv_dvb_3056_config = {
+       .demod_address = 0x08,
+       .invert        = 1,
+       .invert_oclk   = 0,
+       .xtal_freq     = TDA10046_XTAL_16M,
+       .agc_config    = TDA10046_AGC_TDA827X,
+       .gpio_config   = TDA10046_GP01_I,
+       .if_freq       = TDA10046_FREQ_045,
+       .i2c_gate      = 0x42,
+       .tuner_address = 0x61,
+       .tuner_config  = 2,
+       .antenna_switch = 1,
+       .request_firmware = philips_tda1004x_request_firmware
+};
+
 /* ------------------------------------------------------------------
  * special case: this card uses saa713x GPIO22 for the mode switch
  */
@@ -832,7 +866,7 @@ static int dvb_init(struct saa7134_dev *dev)
        dev->ts.nr_bufs    = 32;
        dev->ts.nr_packets = 32*4;
        dev->dvb.name = dev->name;
-       videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops,
+       videobuf_queue_pci_init(&dev->dvb.dvbq, &saa7134_ts_qops,
                            dev->pci, &dev->slock,
                            V4L2_BUF_TYPE_VIDEO_CAPTURE,
                            V4L2_FIELD_ALTERNATE,
@@ -1022,6 +1056,12 @@ static int dvb_init(struct saa7134_dev *dev)
        case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
                configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config);
                break;
+       case SAA7134_BOARD_AVERMEDIA_SUPER_007:
+               configure_tda827x_fe(dev, &avermedia_super_007_config);
+               break;
+       case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
+               configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config);
+               break;
        default:
                wprintk("Huh? unknown DVB card?\n");
                break;
@@ -1051,14 +1091,21 @@ static int dvb_init(struct saa7134_dev *dev)
 
 static int dvb_fini(struct saa7134_dev *dev)
 {
-       static int on  = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
+       /* FIXME: I suspect that this code is bogus, since the entry for
+          Pinnacle 300I DVB-T PAL already defines the proper init to allow
+          the detection of mt2032 (TDA9887_PORT2_INACTIVE)
+        */
+       if (dev->board == SAA7134_BOARD_PINNACLE_300I_DVBT_PAL) {
+               struct v4l2_priv_tun_config tda9887_cfg;
+               static int on  = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
+
+               tda9887_cfg.tuner = TUNER_TDA9887;
+               tda9887_cfg.priv  = &on;
 
-       switch (dev->board) {
-       case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
                /* otherwise we don't detect the tuner on next insmod */
-               saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
-               break;
-       };
+               saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &tda9887_cfg);
+       }
+
        videobuf_dvb_unregister(&dev->dvb);
        return 0;
 }
This page took 0.033584 seconds and 5 git commands to generate.