V4L/DVB (7415): use tuner-simple for Philips TUV1236D digital tuning support
[safe/jmp/linux-2.6] / drivers / media / video / saa7134 / saa7134-dvb.c
index f95f5f2..9f8730b 100644 (file)
@@ -47,6 +47,7 @@
 #include "isl6421.h"
 #include "isl6405.h"
 #include "lnbp21.h"
+#include "tuner-simple.h"
 
 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
 MODULE_LICENSE("GPL");
@@ -929,8 +930,9 @@ static int dvb_init(struct saa7134_dev *dev)
                dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
-                                  NULL, DVB_PLL_PHILIPS_TD1316);
+                       dvb_attach(simple_tuner_attach, dev->dvb.frontend,
+                                  &dev->i2c_adap, 0x61,
+                                  TUNER_PHILIPS_TD1316);
                }
                break;
        case SAA7134_BOARD_MD7134:
@@ -938,8 +940,9 @@ static int dvb_init(struct saa7134_dev *dev)
                                               &medion_cardbus,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
-                                  &dev->i2c_adap, DVB_PLL_FMD1216ME);
+                       dvb_attach(simple_tuner_attach, dev->dvb.frontend,
+                                  &dev->i2c_adap, medion_cardbus.tuner_address,
+                                  TUNER_PHILIPS_FMD1216ME_MK3);
                }
                break;
        case SAA7134_BOARD_PHILIPS_TOUGH:
@@ -1052,10 +1055,12 @@ static int dvb_init(struct saa7134_dev *dev)
                                                        &dev->i2c_adap, 0x08, 0, 0) == NULL)
                                                wprintk("%s: Medion Quadro, no ISL6405 "
                                                        "found !\n", __func__);
-                                       /* fire up the 2nd section of the LNB supply since we can't do
-                                       this from the other section */
-                                       msg.buf = &data;
-                                       i2c_transfer(&dev->i2c_adap, &msg, 1);
+                                       if (dev_id == 0x07) {
+                                               /* fire up the 2nd section of the LNB supply since
+                                                  we can't do this from the other section */
+                                               msg.buf = &data;
+                                               i2c_transfer(&dev->i2c_adap, &msg, 1);
+                                       }
                                        fe->ops.i2c_gate_ctrl(fe, 0);
                                        dev->original_set_voltage = fe->ops.set_voltage;
                                        fe->ops.set_voltage = md8800_set_voltage;
@@ -1080,8 +1085,9 @@ static int dvb_init(struct saa7134_dev *dev)
                dev->dvb.frontend = dvb_attach(nxt200x_attach, &kworldatsc110,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
-                                  NULL, DVB_PLL_TUV1236D);
+                       dvb_attach(simple_tuner_attach, dev->dvb.frontend,
+                                  &dev->i2c_adap, 0x61,
+                                  TUNER_PHILIPS_TUV1236D);
                }
                break;
        case SAA7134_BOARD_FLYDVBS_LR300:
@@ -1106,8 +1112,9 @@ static int dvb_init(struct saa7134_dev *dev)
                        dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
                        dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
 
-                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address,
-                                  &dev->i2c_adap, DVB_PLL_FMD1216ME);
+                       dvb_attach(simple_tuner_attach, dev->dvb.frontend,
+                                  &dev->i2c_adap, medion_cardbus.tuner_address,
+                                  TUNER_PHILIPS_FMD1216ME_MK3);
                }
                break;
        case SAA7134_BOARD_VIDEOMATE_DVBT_200A:
@@ -1197,7 +1204,6 @@ static int dvb_init(struct saa7134_dev *dev)
                struct xc2028_config cfg = {
                        .i2c_adap  = &dev->i2c_adap,
                        .i2c_addr  = 0x61,
-                       .video_dev = dev->i2c_adap.algo_data,
                };
                fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg);
                if (!fe) {
@@ -1248,7 +1254,7 @@ static int dvb_fini(struct saa7134_dev *dev)
                /* otherwise we don't detect the tuner on next insmod */
                saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &tda9887_cfg);
        } else if (dev->board == SAA7134_BOARD_MEDION_MD8800_QUADRO) {
-               if ((dev->eedata[2] != 0x08) && use_frontend) {
+               if ((dev->eedata[2] == 0x07) && use_frontend) {
                        /* turn off the 2nd lnb supply */
                        u8 data = 0x80;
                        struct i2c_msg msg = {.addr = 0x08, .buf = &data, .flags = 0, .len = 1};