]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (4835): Added support for the Terratec Cinergy HT PCMCIA module
authorHartmut Hackmann <hartmut.hackmann@t-online.de>
Thu, 16 Nov 2006 00:31:54 +0000 (21:31 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 10 Dec 2006 10:51:27 +0000 (08:51 -0200)
This is a hybrid cardbus module. Besides the card support, i
modified the definition names for AGC and GPIO of the tda10046.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Documentation/video4linux/CARDLIST.saa7134
drivers/media/dvb/frontends/tda1004x.c
drivers/media/dvb/frontends/tda1004x.h
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/saa7134/saa7134.h

index ef67ace59cb6e82cd696a39e01e6018f087b35d0..f6201cc37ec5fb608418b2e8b0cf64aeb33911ad 100644 (file)
 102 -> Avermedia AVerTV Studio 507              [1461:9715]
 103 -> Compro Videomate DVB-T200A
 104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid     [0070:6701]
+105 -> Terratec Cinergy HT PCMCIA               [153b:1172]
index 11e0dca9a2d7307de9e1a6648eedd4311844f9f1..00e4bcd9f1a4304e5ec99dbaeab0899af9b8de6e 100644 (file)
@@ -648,18 +648,24 @@ static int tda10046_init(struct dvb_frontend* fe)
                tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x0a); // AGC setup
                tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x00); // set AGC polarities
                break;
-       case TDA10046_AGC_TDA827X:
+       case TDA10046_AGC_TDA827X_GP11:
                tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02);   // AGC setup
                tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70);    // AGC Threshold
                tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize
                tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x6a); // set AGC polarities
                break;
-       case TDA10046_AGC_TDA827X_GPL:
+       case TDA10046_AGC_TDA827X_GP00:
                tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02);   // AGC setup
                tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70);    // AGC Threshold
                tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize
                tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x60); // set AGC polarities
                break;
+       case TDA10046_AGC_TDA827X_GP01:
+               tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02);   // AGC setup
+               tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70);    // AGC Threshold
+               tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize
+               tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x62); // set AGC polarities
+               break;
        }
        tda1004x_write_byteI(state, TDA1004X_CONFADC2, 0x38);
        tda1004x_write_byteI(state, TDA10046H_CONF_TRISTATE1, 0x61); // Turn both AGC outputs on
index 605ad2dfc09db7454e81c45d5907f0c3e4284771..ec502d71b83c6c170a993d0604e705fd96a10338 100644 (file)
@@ -35,8 +35,9 @@ enum tda10046_agc {
        TDA10046_AGC_DEFAULT,           /* original configuration */
        TDA10046_AGC_IFO_AUTO_NEG,      /* IF AGC only, automatic, negtive */
        TDA10046_AGC_IFO_AUTO_POS,      /* IF AGC only, automatic, positive */
-       TDA10046_AGC_TDA827X,           /* IF AGC only, special setup for tda827x */
-       TDA10046_AGC_TDA827X_GPL,       /* same as above, but GPIOs 0 */
+       TDA10046_AGC_TDA827X_GP11,      /* IF AGC only, special setup for tda827x */
+       TDA10046_AGC_TDA827X_GP00,      /* same as above, but GPIOs 0 */
+       TDA10046_AGC_TDA827X_GP01,      /* same as above, but GPIO3=0 GPIO1=1*/
 };
 
 enum tda10046_if {
index d8d8142d921b1a7ac875fc35602efda168041f0d..d0ddc65d7eb194d5d308a1967894c680c1961c3c 100644 (file)
@@ -3148,6 +3148,29 @@ struct saa7134_board saa7134_boards[] = {
                        .gpio   = 0x0200000,
                },
        },
+       [SAA7134_BOARD_CINERGY_HT_PCMCIA] = {
+               .name           = "Terratec Cinergy HT PCMCIA",
+               .audio_clock    = 0x00187de7,
+               .tuner_type     = TUNER_PHILIPS_TDA8290,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .mpeg           = SAA7134_MPEG_DVB,
+               .inputs = {{
+                       .name   = name_tv,
+                       .vmux   = 1,
+                       .amux   = TV,
+                       .tv     = 1,
+               },{
+                       .name   = name_comp1,
+                       .vmux   = 0,
+                       .amux   = LINE1,
+               },{
+                       .name   = name_svideo,
+                       .vmux   = 6,
+                       .amux   = LINE1,
+               }},
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -3780,6 +3803,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subvendor    = 0x0070,
                .subdevice    = 0x6701,
                .driver_data  = SAA7134_BOARD_HAUPPAUGE_HVR1110,
+       },{
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7133,
+               .subvendor    = 0x153b,
+               .subdevice    = 0x1172,
+               .driver_data  = SAA7134_BOARD_CINERGY_HT_PCMCIA,
        },{
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -4107,6 +4136,14 @@ int saa7134_board_init2(struct saa7134_dev *dev)
                i2c_transfer(&dev->i2c_adap, &msg, 1);
                }
                break;
+       case SAA7134_BOARD_CINERGY_HT_PCMCIA:
+               /* make the tda10046 find its eeprom */
+               {
+               u8 data[] = { 0x3c, 0x33, 0x60};
+               struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
+               i2c_transfer(&dev->i2c_adap, &msg, 1);
+               }
+               break;
        case SAA7134_BOARD_KWORLD_ATSC110:
                {
                        /* enable tuner */
index a51264f636fdccdace5674cf1a51b38869079405..ce888f70495658c1567a82ff0b6168ac83864591 100644 (file)
@@ -677,7 +677,7 @@ static struct tda1004x_config tda827x_lifeview_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -881,7 +881,40 @@ static struct tda1004x_config philips_tiger_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
+       .if_freq       = TDA10046_FREQ_045,
+       .request_firmware = NULL,
+};
+/* ------------------------------------------------------------------ */
+
+static int cinergy_ht_tuner_init(struct dvb_frontend *fe)
+{
+       struct saa7134_dev *dev = fe->dvb->priv;
+       static u8 data[] = { 0x3c, 0x33, 0x62};
+       struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
+
+       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
+               return -EIO;
+       return 0;
+}
+
+static int cinergy_ht_tuner_sleep(struct dvb_frontend *fe)
+{
+       struct saa7134_dev *dev = fe->dvb->priv;
+       static u8 data[] = { 0x3c, 0x33, 0x60};
+       struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
+
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
+       philips_tda827xa_tuner_sleep( 0x61, fe);
+       return 0;
+}
+
+static struct tda1004x_config cinergy_ht_config = {
+       .demod_address = 0x08,
+       .invert        = 1,
+       .invert_oclk   = 0,
+       .xtal_freq     = TDA10046_XTAL_16M,
+       .agc_config    = TDA10046_AGC_TDA827X_GP01,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -893,7 +926,7 @@ static struct tda1004x_config pinnacle_pctv_310i_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = philips_tda1004x_request_firmware,
 };
@@ -905,7 +938,7 @@ static struct tda1004x_config hauppauge_hvr_1110_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = philips_tda1004x_request_firmware,
 };
@@ -917,7 +950,7 @@ static struct tda1004x_config asus_p7131_dual_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = philips_tda1004x_request_firmware,
 };
@@ -969,7 +1002,7 @@ static struct tda1004x_config lifeview_trio_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X_GPL,
+       .agc_config    = TDA10046_AGC_TDA827X_GP00,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -1006,7 +1039,7 @@ static struct tda1004x_config ads_tech_duo_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X_GPL,
+       .agc_config    = TDA10046_AGC_TDA827X_GP00,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -1031,7 +1064,7 @@ static struct tda1004x_config tevion_dvbt220rf_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -1076,7 +1109,7 @@ static struct tda1004x_config md8800_dvbt_config = {
        .invert        = 1,
        .invert_oclk   = 0,
        .xtal_freq     = TDA10046_XTAL_16M,
-       .agc_config    = TDA10046_AGC_TDA827X,
+       .agc_config    = TDA10046_AGC_TDA827X_GP11,
        .if_freq       = TDA10046_FREQ_045,
        .request_firmware = NULL,
 };
@@ -1362,6 +1395,18 @@ static int dvb_init(struct saa7134_dev *dev)
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
                }
                break;
+       case SAA7134_BOARD_CINERGY_HT_PCMCIA:
+               dev->dvb.frontend = dvb_attach(tda10046_attach,
+                                              &cinergy_ht_config,
+                                              &dev->i2c_adap);
+               if (dev->dvb.frontend) {
+                       dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
+                       dev->dvb.frontend->ops.tuner_ops.init = cinergy_ht_tuner_init;
+                       dev->dvb.frontend->ops.tuner_ops.sleep = cinergy_ht_tuner_sleep;
+                       dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
+
+               }
+               break;
        default:
                printk("%s: Huh? unknown DVB card?\n",dev->name);
                break;
index fee75123f9a6b3cd11d8076856d846cbbda617a1..e88ad7b40c47be8880adfed0c15b6eda922526c7 100644 (file)
@@ -230,7 +230,8 @@ struct saa7134_format {
 #define SAA7134_BOARD_PINNACLE_PCTV_310i  101
 #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102
 #define SAA7134_BOARD_VIDEOMATE_DVBT_200A  103
-#define SAA7134_BOARD_HAUPPAUGE_HVR1110 104
+#define SAA7134_BOARD_HAUPPAUGE_HVR1110    104
+#define SAA7134_BOARD_CINERGY_HT_PCMCIA    105
 
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8