]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/saa7134/saa7134-dvb.c
V4L/DVB (6144): Fix mux setup for composite sound on AverTV 307
[linux-2.6-omap-h63xx.git] / drivers / media / video / saa7134 / saa7134-dvb.c
index 7985d9e860e9dc12a59640145c1c3e0aa5059d0f..1f6bd3300715994db922aff1b00de86f7953410a 100644 (file)
@@ -60,8 +60,12 @@ static int debug = 0;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off).");
 
-#define dprintk(fmt, arg...)   if (debug) \
-       printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg)
+#define dprintk(fmt, arg...)   do { if (debug) \
+       printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0)
+
+/* Print a warning */
+#define wprintk(fmt, arg...) \
+       printk(KERN_WARNING "%s/dvb: " fmt, dev->name, ## arg)
 
 /* ------------------------------------------------------------------
  * mt352 based DVB-T cards
@@ -87,8 +91,7 @@ static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on)
        saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2,   (1 << 28));
        udelay(10);
        ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27);
-       printk("%s: %s %s\n", dev->name, __FUNCTION__,
-              ok ? "on" : "off");
+       dprintk("%s %s\n", __FUNCTION__, ok ? "on" : "off");
 
        if (!ok)
                saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2,   (1 << 26));
@@ -108,7 +111,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
        static u8 irq_cfg []       = { INTERRUPT_EN_0, 0x00, 0x00, 0x00, 0x00 };
        struct saa7134_dev *dev= fe->dvb->priv;
 
-       printk("%s: %s called\n",dev->name,__FUNCTION__);
+       dprintk("%s called\n", __FUNCTION__);
 
        mt352_write(fe, clock_config,   sizeof(clock_config));
        udelay(200);
@@ -172,18 +175,6 @@ static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
        return mt352_pinnacle_init(fe);
 }
 
-static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
-{
-       if (buf_len < 5)
-               return -EINVAL;
-
-       pllbuf[0] = 0x61;
-       dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1,
-                         params->frequency,
-                         params->u.ofdm.bandwidth);
-       return 5;
-}
-
 static struct mt352_config pinnacle_300i = {
        .demod_address = 0x3c >> 1,
        .adc_clock     = 20333,
@@ -208,15 +199,6 @@ static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
        return request_firmware(fw, name, &dev->pci->dev);
 }
 
-static void philips_tda1004x_set_board_name(struct dvb_frontend *fe, char *name)
-{
-       size_t len;
-
-       len = sizeof(fe->ops.info.name);
-       strncpy(fe->ops.info.name, name, len);
-       fe->ops.info.name[len - 1] = 0;
-}
-
 /* ------------------------------------------------------------------
  * these tuners are tu1216, td1316(a)
  */
@@ -301,7 +283,8 @@ static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
        if (fe->ops.i2c_gate_ctrl)
                fe->ops.i2c_gate_ctrl(fe, 1);
        if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) {
-               printk("%s/dvb: could not write to tuner at addr: 0x%02x\n",dev->name, addr << 1);
+               wprintk("could not write to tuner at addr: 0x%02x\n",
+                       addr << 1);
                return -EIO;
        }
        msleep(1);
@@ -449,134 +432,6 @@ static struct tda1004x_config philips_europa_config = {
 
 /* ------------------------------------------------------------------ */
 
-static int philips_fmd1216_tuner_init(struct dvb_frontend *fe)
-{
-       struct saa7134_dev *dev = fe->dvb->priv;
-       struct tda1004x_state *state = fe->demodulator_priv;
-       u8 addr = state->config->tuner_address;
-       /* this message is to set up ATC and ALC */
-       static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 };
-       struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
-
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
-               return -EIO;
-       msleep(1);
-
-       return 0;
-}
-
-static int philips_fmd1216_tuner_sleep(struct dvb_frontend *fe)
-{
-       struct saa7134_dev *dev = fe->dvb->priv;
-       struct tda1004x_state *state = fe->demodulator_priv;
-       u8 addr = state->config->tuner_address;
-       /* this message actually turns the tuner back to analog mode */
-       static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 };
-       struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
-
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
-       msleep(1);
-       fmd1216_init[2] = 0x86;
-       fmd1216_init[3] = 0x54;
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
-       msleep(1);
-       return 0;
-}
-
-static int philips_fmd1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
-{
-       struct saa7134_dev *dev = fe->dvb->priv;
-       struct tda1004x_state *state = fe->demodulator_priv;
-       u8 addr = state->config->tuner_address;
-       u8 tuner_buf[4];
-       struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len =
-                       sizeof(tuner_buf) };
-       int tuner_frequency = 0;
-       int divider = 0;
-       u8 band, mode, cp;
-
-       /* determine charge pump */
-       tuner_frequency = params->frequency + 36130000;
-       if (tuner_frequency < 87000000)
-               return -EINVAL;
-       /* low band */
-       else if (tuner_frequency < 180000000) {
-               band = 1;
-               mode = 7;
-               cp   = 0;
-       } else if (tuner_frequency < 195000000) {
-               band = 1;
-               mode = 6;
-               cp   = 1;
-       /* mid band     */
-       } else if (tuner_frequency < 366000000) {
-               if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) {
-                       band = 10;
-               } else {
-                       band = 2;
-               }
-               mode = 7;
-               cp   = 0;
-       } else if (tuner_frequency < 478000000) {
-               if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) {
-                       band = 10;
-               } else {
-                       band = 2;
-               }
-               mode = 6;
-               cp   = 1;
-       /* high band */
-       } else if (tuner_frequency < 662000000) {
-               if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) {
-                       band = 12;
-               } else {
-                       band = 4;
-               }
-               mode = 7;
-               cp   = 0;
-       } else if (tuner_frequency < 840000000) {
-               if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) {
-                       band = 12;
-               } else {
-                       band = 4;
-               }
-               mode = 6;
-               cp   = 1;
-       } else {
-               if (params->u.ofdm.bandwidth == BANDWIDTH_8_MHZ) {
-                       band = 12;
-               } else {
-                       band = 4;
-               }
-               mode = 7;
-               cp   = 1;
-
-       }
-       /* calculate divisor */
-       /* ((36166000 + Finput) / 166666) rounded! */
-       divider = (tuner_frequency + 83333) / 166667;
-
-       /* setup tuner buffer */
-       tuner_buf[0] = (divider >> 8) & 0x7f;
-       tuner_buf[1] = divider & 0xff;
-       tuner_buf[2] = 0x80 | (cp << 6) | (mode  << 3) | 4;
-       tuner_buf[3] = 0x40 | band;
-
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) {
-               printk("%s/dvb: could not write to tuner at addr: 0x%02x\n",dev->name, addr << 1);
-               return -EIO;
-       }
-       return 0;
-}
-
 static struct tda1004x_config medion_cardbus = {
        .demod_address = 0x08,
        .invert        = 1,
@@ -618,7 +473,8 @@ static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
                saa7134_set_gpio(dev, 22, 0);
                GP00_LEV[1] = high ? 0 : 1;
                if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
-                       printk("%s/dvb: could not access tda8290 at addr: 0x%02x\n",dev->name, addr << 1);
+                       wprintk("could not access tda8290 at addr: 0x%02x\n",
+                               addr << 1);
                        return;
                }
                msg.buf = GP00_LEV;
@@ -634,7 +490,6 @@ static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
 
 static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
 {
-       struct saa7134_dev *dev = fe->dvb->priv;
        struct tda1004x_state *state = fe->demodulator_priv;
 
        u8 addr = state->config->i2c_gate;
@@ -646,8 +501,9 @@ static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
        } else {
                tda8290_msg.buf = tda8290_open;
        }
-       if (i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1) != 1) {
-               printk("%s/dvb: could not access tda8290 I2C gate\n",dev->name);
+       if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) {
+               struct saa7134_dev *dev = fe->dvb->priv;
+               wprintk("could not access tda8290 I2C gate\n");
                return -EIO;
        }
        msleep(20);
@@ -696,17 +552,18 @@ static struct tda827x_config tda827x_cfg = {
        .sleep = philips_tda827x_tuner_sleep
 };
 
-static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *tda_conf,
-                                char *board_name)
+static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *tda_conf)
 {
        dev->dvb.frontend = dvb_attach(tda10046_attach, tda_conf, &dev->i2c_adap);
        if (dev->dvb.frontend) {
                if (tda_conf->i2c_gate)
                        dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
-               dvb_attach(tda827x_attach,dev->dvb.frontend,
-                          tda_conf->tuner_address,&dev->i2c_adap,&tda827x_cfg);
+               if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address,
+                                               &dev->i2c_adap,&tda827x_cfg) == NULL) {
+                       wprintk("no tda827x tuner found at addr: %02x\n",
+                               tda_conf->tuner_address);
+               }
        }
-       philips_tda1004x_set_board_name(dev->dvb.frontend, board_name);
 }
 
 /* ------------------------------------------------------------------ */
@@ -860,6 +717,49 @@ static struct tda1004x_config md8800_dvbt_config = {
        .request_firmware = philips_tda1004x_request_firmware
 };
 
+static struct tda1004x_config asus_p7131_4871_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 = 0x61,
+       .tuner_config  = 2,
+       .antenna_switch= 2,
+       .request_firmware = philips_tda1004x_request_firmware
+};
+
+static struct tda1004x_config asus_p7131_hybrid_lna_config = {
+       .demod_address = 0x08,
+       .invert        = 1,
+       .invert_oclk   = 0,
+       .xtal_freq     = TDA10046_XTAL_16M,
+       .agc_config    = TDA10046_AGC_TDA827X,
+       .gpio_config   = TDA10046_GP11_I,
+       .if_freq       = TDA10046_FREQ_045,
+       .i2c_gate      = 0x4b,
+       .tuner_address = 0x61,
+       .tuner_config  = 2,
+       .antenna_switch= 2,
+       .request_firmware = philips_tda1004x_request_firmware
+};
+static struct tda1004x_config kworld_dvb_t_210_config = {
+       .demod_address = 0x08,
+       .invert        = 1,
+       .invert_oclk   = 0,
+       .xtal_freq     = TDA10046_XTAL_16M,
+       .agc_config    = TDA10046_AGC_TDA827X,
+       .gpio_config   = TDA10046_GP11_I,
+       .if_freq       = TDA10046_FREQ_045,
+       .i2c_gate      = 0x4b,
+       .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
  */
@@ -869,7 +769,7 @@ static int ads_duo_tuner_init(struct dvb_frontend *fe)
        struct saa7134_dev *dev = fe->dvb->priv;
        philips_tda827x_tuner_init(fe);
        /* route TDA8275a AGC input to the channel decoder */
-       saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0400000);
+       saa7134_set_gpio(dev, 22, 1);
        return 0;
 }
 
@@ -877,7 +777,7 @@ static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
 {
        struct saa7134_dev *dev = fe->dvb->priv;
        /* route TDA8275a AGC input to the analog IF chip*/
-       saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0400000);
+       saa7134_set_gpio(dev, 22, 0);
        philips_tda827x_tuner_sleep(fe);
        return 0;
 }
@@ -917,18 +817,8 @@ static struct nxt200x_config avertvhda180 = {
        .demod_address    = 0x0a,
 };
 
-static int nxt200x_set_pll_input(u8 *buf, int input)
-{
-       if (input)
-               buf[3] |= 0x08;
-       else
-               buf[3] &= ~0x08;
-       return 0;
-}
-
 static struct nxt200x_config kworldatsc110 = {
        .demod_address    = 0x0a,
-       .set_pll_input    = nxt200x_set_pll_input,
 };
 
 /* ==================================================================
@@ -937,7 +827,7 @@ static struct nxt200x_config kworldatsc110 = {
 
 static int dvb_init(struct saa7134_dev *dev)
 {
-       char *board_name;
+       int ret;
        /* init struct videobuf_dvb */
        dev->ts.nr_bufs    = 32;
        dev->ts.nr_packets = 32*4;
@@ -951,7 +841,7 @@ static int dvb_init(struct saa7134_dev *dev)
 
        switch (dev->board) {
        case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
-               printk("%s: pinnacle 300i dvb setup\n",dev->name);
+               dprintk("pinnacle 300i dvb setup\n");
                dev->dvb.frontend = dvb_attach(mt352_attach, &pinnacle_300i,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
@@ -960,11 +850,12 @@ static int dvb_init(struct saa7134_dev *dev)
                break;
        case SAA7134_BOARD_AVERMEDIA_777:
        case SAA7134_BOARD_AVERMEDIA_A16AR:
-               printk("%s: avertv 777 dvb setup\n",dev->name);
+               dprintk("avertv 777 dvb setup\n");
                dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dev->dvb.frontend->ops.tuner_ops.calc_regs = mt352_aver777_tuner_calc_regs;
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
+                                  NULL, DVB_PLL_PHILIPS_TD1316);
                }
                break;
        case SAA7134_BOARD_MD7134:
@@ -972,10 +863,8 @@ static int dvb_init(struct saa7134_dev *dev)
                                               &medion_cardbus,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
-                       dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
-                       dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, "DVB-T Medion MD7134");
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
+                                  &dev->i2c_adap, DVB_PLL_FMD1216ME);
                }
                break;
        case SAA7134_BOARD_PHILIPS_TOUGH:
@@ -985,12 +874,11 @@ static int dvb_init(struct saa7134_dev *dev)
                if (dev->dvb.frontend) {
                        dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init;
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set;
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, "DVB-T Philips TOUGH");
                }
                break;
        case SAA7134_BOARD_FLYDVBTDUO:
        case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
-               configure_tda827x_fe(dev, &tda827x_lifeview_config, "DVB-T Lifeview FlyDVB Duo");
+               configure_tda827x_fe(dev, &tda827x_lifeview_config);
                break;
        case SAA7134_BOARD_PHILIPS_EUROPA:
        case SAA7134_BOARD_VIDEOMATE_DVBT_300:
@@ -1003,11 +891,6 @@ static int dvb_init(struct saa7134_dev *dev)
                        dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
                        dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep;
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
-                       if (dev->board == SAA7134_BOARD_VIDEOMATE_DVBT_300)
-                               board_name = "DVB-T Compro VideoMate 300";
-                       else
-                               board_name = "DVB-T Philips Europa";
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, board_name);
                }
                break;
        case SAA7134_BOARD_VIDEOMATE_DVBT_200:
@@ -1017,37 +900,39 @@ static int dvb_init(struct saa7134_dev *dev)
                if (dev->dvb.frontend) {
                        dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init;
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set;
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, "DVB-T Compro VideoMate 200");
                }
                break;
+       case SAA7134_BOARD_KWORLD_DVBT_210:
+               configure_tda827x_fe(dev, &kworld_dvb_t_210_config);
+               break;
        case SAA7134_BOARD_PHILIPS_TIGER:
-               configure_tda827x_fe(dev, &philips_tiger_config, "DVB-T Philips Tiger");
+               configure_tda827x_fe(dev, &philips_tiger_config);
                break;
        case SAA7134_BOARD_PINNACLE_PCTV_310i:
-               configure_tda827x_fe(dev, &pinnacle_pctv_310i_config, "DVB-T Pinnacle PCTV 310i");
+               configure_tda827x_fe(dev, &pinnacle_pctv_310i_config);
                break;
        case SAA7134_BOARD_HAUPPAUGE_HVR1110:
-               configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, "DVB-T Hauppauge HVR 1110");
+               configure_tda827x_fe(dev, &hauppauge_hvr_1110_config);
                break;
        case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
-               configure_tda827x_fe(dev, &asus_p7131_dual_config, "DVB-T Asus P7137 Dual");
+               configure_tda827x_fe(dev, &asus_p7131_dual_config);
                break;
        case SAA7134_BOARD_FLYDVBT_LR301:
-               configure_tda827x_fe(dev, &tda827x_lifeview_config, "DVB-T Lifeview FlyDVBT LR301");
+               configure_tda827x_fe(dev, &tda827x_lifeview_config);
                break;
        case SAA7134_BOARD_FLYDVB_TRIO:
                if(! use_frontend) {    //terrestrial
-                       configure_tda827x_fe(dev, &lifeview_trio_config, NULL);
+                       configure_tda827x_fe(dev, &lifeview_trio_config);
                } else {              //satellite
                        dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap);
                        if (dev->dvb.frontend) {
                                if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63,
                                                                        &dev->i2c_adap, 0) == NULL) {
-                                       printk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__);
+                                       wprintk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__);
                                }
                                if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap,
                                                                                0x08, 0, 0) == NULL) {
-                                       printk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__);
+                                       wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__);
                                }
                        }
                }
@@ -1058,28 +943,26 @@ static int dvb_init(struct saa7134_dev *dev)
                                               &ads_tech_duo_config,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dvb_attach(tda827x_attach,dev->dvb.frontend,
+                       if (dvb_attach(tda827x_attach,dev->dvb.frontend,
                                   ads_tech_duo_config.tuner_address,
-                                  &dev->i2c_adap,&ads_duo_cfg);
-                       if (dev->board == SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331)
-                               board_name = "DVB-T ADS DUO Cardbus PTV331";
-                       else
-                               board_name = "DVB-T Lifeview FlyDVT Cardbus";
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, board_name);
+                                  &dev->i2c_adap,&ads_duo_cfg) == NULL) {
+                               wprintk("no tda827x tuner found at addr: %02x\n",
+                                       ads_tech_duo_config.tuner_address);
+                       }
                }
                break;
        case SAA7134_BOARD_TEVION_DVBT_220RF:
-               configure_tda827x_fe(dev, &tevion_dvbt220rf_config, "DVB-T Tevion 220RF");
+               configure_tda827x_fe(dev, &tevion_dvbt220rf_config);
                break;
        case SAA7134_BOARD_MEDION_MD8800_QUADRO:
-               configure_tda827x_fe(dev, &md8800_dvbt_config, "DVB-T Medion MD8800");
+               configure_tda827x_fe(dev, &md8800_dvbt_config);
                break;
        case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180:
                dev->dvb.frontend = dvb_attach(nxt200x_attach, &avertvhda180,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
                        dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
-                                  NULL, &dvb_pll_tdhu2);
+                                  NULL, DVB_PLL_TDHU2);
                }
                break;
        case SAA7134_BOARD_KWORLD_ATSC110:
@@ -1087,7 +970,7 @@ static int dvb_init(struct saa7134_dev *dev)
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
                        dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
-                                  NULL, &dvb_pll_tuv1236d);
+                                  NULL, DVB_PLL_TUV1236D);
                }
                break;
        case SAA7134_BOARD_FLYDVBS_LR300:
@@ -1096,11 +979,11 @@ static int dvb_init(struct saa7134_dev *dev)
                if (dev->dvb.frontend) {
                        if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60,
                                       &dev->i2c_adap, 0) == NULL) {
-                               printk("%s: No tda826x found!\n", __FUNCTION__);
+                               wprintk("%s: No tda826x found!\n", __FUNCTION__);
                        }
                        if (dvb_attach(isl6421_attach, dev->dvb.frontend,
                                       &dev->i2c_adap, 0x08, 0, 0) == NULL) {
-                               printk("%s: No ISL6421 found!\n", __FUNCTION__);
+                               wprintk("%s: No ISL6421 found!\n", __FUNCTION__);
                        }
                }
                break;
@@ -1110,10 +993,9 @@ static int dvb_init(struct saa7134_dev *dev)
                if (dev->dvb.frontend) {
                        dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
                        dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
-                       dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
-                       dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
-                       dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, "DVBT Asus Europa 2 Hybrid");
+
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
+                                  &dev->i2c_adap, DVB_PLL_FMD1216ME);
                }
                break;
        case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
@@ -1123,30 +1005,48 @@ static int dvb_init(struct saa7134_dev *dev)
                if (dev->dvb.frontend) {
                        dev->dvb.frontend->ops.tuner_ops.init = philips_td1316_tuner_init;
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
-                       philips_tda1004x_set_board_name(dev->dvb.frontend, "DVBT Compro Videomate 200a");
                }
                break;
        case SAA7134_BOARD_CINERGY_HT_PCMCIA:
-               configure_tda827x_fe(dev, &cinergy_ht_config, "DVB-T Terratec Cinergy HT Cardbus");
+               configure_tda827x_fe(dev, &cinergy_ht_config);
                break;
        case SAA7134_BOARD_CINERGY_HT_PCI:
-               configure_tda827x_fe(dev, &cinergy_ht_pci_config, "DVB-T Terratec Cinergy HT PCI");
+               configure_tda827x_fe(dev, &cinergy_ht_pci_config);
                break;
        case SAA7134_BOARD_PHILIPS_TIGER_S:
-               configure_tda827x_fe(dev, &philips_tiger_s_config, "DVB-T Philips Tiger S");
+               configure_tda827x_fe(dev, &philips_tiger_s_config);
+               break;
+       case SAA7134_BOARD_ASUS_P7131_4871:
+               configure_tda827x_fe(dev, &asus_p7131_4871_config);
+               break;
+       case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
+               configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config);
                break;
        default:
-               printk("%s: Huh? unknown DVB card?\n",dev->name);
+               wprintk("Huh? unknown DVB card?\n");
                break;
        }
 
        if (NULL == dev->dvb.frontend) {
-               printk("%s: frontend initialization failed\n",dev->name);
+               printk(KERN_ERR "%s/dvb: frontend initialization failed\n", dev->name);
                return -1;
        }
 
        /* register everything else */
-       return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+       ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
+
+       /* this sequence is necessary to make the tda1004x load its firmware
+        * and to enter analog mode of hybrid boards
+        */
+       if (!ret) {
+               if (dev->dvb.frontend->ops.init)
+                       dev->dvb.frontend->ops.init(dev->dvb.frontend);
+               if (dev->dvb.frontend->ops.sleep)
+                       dev->dvb.frontend->ops.sleep(dev->dvb.frontend);
+               if (dev->dvb.frontend->ops.tuner_ops.sleep)
+                       dev->dvb.frontend->ops.tuner_ops.sleep(dev->dvb.frontend);
+       }
+       return ret;
 }
 
 static int dvb_fini(struct saa7134_dev *dev)