V4L/DVB (5363): Dvb: Remove lgh06xf driver
authorTrent Piepho <xyzzy@speakeasy.org>
Fri, 27 Apr 2007 15:31:30 +0000 (12:31 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:44:05 +0000 (15:44 -0300)
The code of the dvb-pll driver and the lgh06xf driver is nearly
identical.  The main difference is that the lgh06xf driver would set the
AGC TOP value on every tune call.  The dvb-pll driver now has the ability
to set the AGC TOP when the front-end device is opened, which is a better
way to go about it.  By using this ability of dvb-pll, the lgh06xf driver
is made unnecessary.

There is one other difference.  dvb-pll will probe for the presence of an
I2C pll chip by doing a one byte read, the lgh06xf driver did not do
this.  In some devices the PLL is not reachable over I2C at the timer the
tuner is attached.  Some more initialization, such as firmware loading,
must take place first.  None of the devices using a LG-H06xF should have
this problem.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
14 files changed:
drivers/media/dvb/b2c2/Kconfig
drivers/media/dvb/b2c2/flexcop-fe-tuner.c
drivers/media/dvb/bt8xx/Kconfig
drivers/media/dvb/bt8xx/dvb-bt8xx.c
drivers/media/dvb/bt8xx/dvb-bt8xx.h
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/cxusb.c
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/Makefile
drivers/media/dvb/frontends/dvb-pll.c
drivers/media/dvb/frontends/lgh06xf.c [deleted file]
drivers/media/dvb/frontends/lgh06xf.h [deleted file]
drivers/media/video/cx88/Kconfig
drivers/media/video/cx88/cx88-dvb.c

index 79875958930e1ba4a53d18ee5f0b94b52cb03f59..a0dcd59da76e5833502814abf62d66eda780ae79 100644 (file)
@@ -9,7 +9,6 @@ config DVB_B2C2_FLEXCOP
        select DVB_STV0297 if !DVB_FE_CUSTOMISE
        select DVB_BCM3510 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select DVB_TUNER_LGH06XF if !DVB_FE_CUSTOMISE
        help
          Support for the digital TV receiver chip made by B2C2 Inc. included in
          Technisats PCI cards and USB boxes.
index 752cf79c532fca83ee93295e241838ac4b7d357a..b02c2fd65baa9110461293ca8d77c8bd674ee81a 100644 (file)
@@ -14,7 +14,6 @@
 #include "stv0297.h"
 #include "mt312.h"
 #include "lgdt330x.h"
-#include "lgh06xf.h"
 #include "dvb-pll.h"
 
 /* lnb control */
@@ -507,7 +506,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
        /* try the air atsc 3nd generation (lgdt3303) */
        if ((fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
                fc->dev_type          = FC_AIR_ATSC3;
-               dvb_attach(lgh06xf_attach, fc->fe, &fc->i2c_adap);
+               dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_lg_tdvs_h06xf);
                info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address);
        } else
        /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */
index dd66b60fbc98439021bd29bf8eed68ae5c440ffc..cfd6fb729a613d9c83d93176faeec87ac42705d4 100644 (file)
@@ -7,7 +7,7 @@ config DVB_BT8XX
        select DVB_CX24110 if !DVB_FE_CUSTOMISE
        select DVB_OR51211 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select DVB_TUNER_LGH06XF if !DVB_FE_CUSTOMISE
+       select DVB_PLL
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
        select FW_LOADER
        help
index 58f69f6ae3918601e56bc2b10694f7914d3935eb..4f1c09bee538712d42071b04283541b872006f72 100644 (file)
@@ -610,7 +610,8 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
                lgdt330x_reset(card);
                card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter);
                if (card->fe != NULL) {
-                       dvb_attach(lgh06xf_attach, card->fe, card->i2c_adapter);
+                       dvb_attach(dvb_pll_attach, card->fe, 0x61,
+                                  card->i2c_adapter, &dvb_pll_lg_tdvs_h06xf);
                        dprintk ("dvb_bt8xx: lgdt330x detected\n");
                }
                break;
index e75f4173c0592201b743dd79f1be62d83c1a308f..436880e68672fe752859135dbff42790fefd93f3 100644 (file)
@@ -37,8 +37,8 @@
 #include "cx24110.h"
 #include "or51211.h"
 #include "lgdt330x.h"
-#include "lgh06xf.h"
 #include "zl10353.h"
+#include "dvb-pll.h"
 
 struct dvb_bt8xx_card {
        struct mutex lock;
index cb727b81269241419dc13cd2d4561633952c33a8..8aa12722cbd6952089faa534a9c20544e173d27b 100644 (file)
@@ -101,7 +101,6 @@ config DVB_USB_CXUSB
        select DVB_PLL
        select DVB_CX22702 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select DVB_TUNER_LGH06XF if !DVB_FE_CUSTOMISE
        select DVB_MT352 if !DVB_FE_CUSTOMISE
        select DVB_ZL10353 if !DVB_FE_CUSTOMISE
        help
index 127a94b9a1b537c9b0a810eaf0ad92d19f8d71db..bac2ae3b4a1f86972934b946f4168c5da8d109db 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "cx22702.h"
 #include "lgdt330x.h"
-#include "lgh06xf.h"
 #include "mt352.h"
 #include "mt352_priv.h"
 #include "zl10353.h"
@@ -388,7 +387,8 @@ static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
 
 static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
 {
-       dvb_attach(lgh06xf_attach, adap->fe, &adap->dev->i2c_adap);
+       dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
+                  &dvb_pll_lg_tdvs_h06xf);
        return 0;
 }
 
index b255cbe3a99d4f705940bdb169436d6c0cd364e4..10c4e7bdde781877e0a93a7b65faa955640df183 100644 (file)
@@ -315,14 +315,6 @@ config DVB_TUNER_MT2060
        help
          A driver for the silicon IF tuner MT2060 from Microtune.
 
-config DVB_TUNER_LGH06XF
-       tristate "LG TDVS-H06xF ATSC tuner"
-       depends on DVB_CORE && I2C
-       select DVB_PLL
-       default m if DVB_FE_CUSTOMISE
-       help
-         A driver for the LG TDVS-H06xF ATSC tuner family.
-
 comment "Miscellaneous devices"
        depends on DVB_CORE
 
index e038942a1d8a209dc043c31d6eb6810e530e6b62..905fcfc8732ac972a2b4b704d63368a0ef66e29e 100644 (file)
@@ -41,4 +41,3 @@ obj-$(CONFIG_DVB_TDA827X) += tda827x.o
 obj-$(CONFIG_DVB_TUNER_MT2060) += mt2060.o
 obj-$(CONFIG_DVB_TUNER_QT1010) += qt1010.o
 obj-$(CONFIG_DVB_TUA6100) += tua6100.o
-obj-$(CONFIG_DVB_TUNER_LGH06XF) += lgh06xf.o
index e7978442fbe923a015140f4e00b8a30825710c5b..abc08f0ae197d13c98c66d0163ed191bb928bddc 100644 (file)
@@ -245,6 +245,7 @@ struct dvb_pll_desc dvb_pll_lg_tdvs_h06xf = {
        .name  = "LG TDVS-H06xF",
        .min   =  54000000,
        .max   = 863000000,
+       .initdata = tua603x_agc103,
        .count = 3,
        .entries = {
                {  165000000, 44000000, 62500, 0xce, 0x01 },
diff --git a/drivers/media/dvb/frontends/lgh06xf.c b/drivers/media/dvb/frontends/lgh06xf.c
deleted file mode 100644 (file)
index 2202d0c..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *  lgh06xf.c - ATSC Tuner support for LG TDVS-H06xF
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "dvb-pll.h"
-#include "lgh06xf.h"
-
-#define LG_H06XF_PLL_I2C_ADDR 0x61
-
-struct lgh06xf_priv {
-       struct i2c_adapter *i2c;
-       u32 frequency;
-};
-
-static int lgh06xf_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
-static int lgh06xf_set_params(struct dvb_frontend* fe,
-                             struct dvb_frontend_parameters* params)
-{
-       struct lgh06xf_priv *priv = fe->tuner_priv;
-       u8 buf[4];
-       struct i2c_msg msg = { .addr = LG_H06XF_PLL_I2C_ADDR, .flags = 0,
-                              .buf = buf, .len = sizeof(buf) };
-       u32 frequency;
-       int result;
-
-       if ((result = dvb_pll_configure(&dvb_pll_lg_tdvs_h06xf, buf,
-                                       params->frequency, 0)) < 0)
-               return result;
-       else
-               frequency = result;
-
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) {
-               printk(KERN_WARNING "lgh06xf: %s error "
-                      "(addr %02x <- %02x, result = %i)\n",
-                      __FUNCTION__, buf[0], buf[1], result);
-               if (result < 0)
-                       return result;
-               else
-                       return -EREMOTEIO;
-       }
-
-       /* Set the Auxiliary Byte. */
-       buf[0] = buf[2];
-       buf[0] &= ~0x20;
-       buf[0] |= 0x18;
-       buf[1] = 0x50;
-       msg.len = 2;
-       if (fe->ops.i2c_gate_ctrl)
-               fe->ops.i2c_gate_ctrl(fe, 1);
-       if ((result = i2c_transfer(priv->i2c, &msg, 1)) != 1) {
-               printk(KERN_WARNING "lgh06xf: %s error "
-                      "(addr %02x <- %02x, result = %i)\n",
-                      __FUNCTION__, buf[0], buf[1], result);
-               if (result < 0)
-                       return result;
-               else
-                       return -EREMOTEIO;
-       }
-
-       priv->frequency = frequency;
-
-       return 0;
-}
-
-static int lgh06xf_get_frequency(struct dvb_frontend *fe, u32 *frequency)
-{
-       struct lgh06xf_priv *priv = fe->tuner_priv;
-       *frequency = priv->frequency;
-       return 0;
-}
-
-static struct dvb_tuner_ops lgh06xf_tuner_ops = {
-       .release       = lgh06xf_release,
-       .set_params    = lgh06xf_set_params,
-       .get_frequency = lgh06xf_get_frequency,
-};
-
-struct dvb_frontend* lgh06xf_attach(struct dvb_frontend *fe,
-                                   struct i2c_adapter *i2c)
-{
-       struct lgh06xf_priv *priv = NULL;
-
-       priv = kzalloc(sizeof(struct lgh06xf_priv), GFP_KERNEL);
-       if (priv == NULL)
-               return NULL;
-
-       priv->i2c = i2c;
-
-       memcpy(&fe->ops.tuner_ops, &lgh06xf_tuner_ops,
-              sizeof(struct dvb_tuner_ops));
-
-       strlcpy(fe->ops.tuner_ops.info.name, dvb_pll_lg_tdvs_h06xf.name,
-               sizeof(fe->ops.tuner_ops.info.name));
-
-       fe->ops.tuner_ops.info.frequency_min = dvb_pll_lg_tdvs_h06xf.min;
-       fe->ops.tuner_ops.info.frequency_max = dvb_pll_lg_tdvs_h06xf.max;
-
-       fe->tuner_priv = priv;
-       return fe;
-}
-
-EXPORT_SYMBOL(lgh06xf_attach);
-
-MODULE_DESCRIPTION("LG TDVS-H06xF ATSC Tuner support");
-MODULE_AUTHOR("Michael Krufky");
-MODULE_LICENSE("GPL");
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
diff --git a/drivers/media/dvb/frontends/lgh06xf.h b/drivers/media/dvb/frontends/lgh06xf.h
deleted file mode 100644 (file)
index 510b4be..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *  lgh06xf.h - ATSC Tuner support for LG TDVS-H06xF
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef _LGH06XF_H_
-#define _LGH06XF_H_
-#include "dvb_frontend.h"
-
-#if defined(CONFIG_DVB_TUNER_LGH06XF) || (defined(CONFIG_DVB_TUNER_LGH06XF_MODULE) && defined(MODULE))
-extern struct dvb_frontend* lgh06xf_attach(struct dvb_frontend* fe,
-                                           struct i2c_adapter *i2c);
-#else
-static inline struct dvb_frontend* lgh06xf_attach(struct dvb_frontend* fe,
-                                                 struct i2c_adapter *i2c)
-{
-       printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
-       return NULL;
-}
-#endif /* CONFIG_DVB_TUNER_LGH06XF */
-
-#endif /* _LGH06XF_H_ */
index b2a66ba625f99505f88ec1c04189cecc2d602c95..0f9d96963618221fbf8ef43f8b298e00f92e0e95 100644 (file)
@@ -53,7 +53,6 @@ config VIDEO_CX88_DVB
        select DVB_OR51132 if !DVB_FE_CUSTOMISE
        select DVB_CX22702 if !DVB_FE_CUSTOMISE
        select DVB_LGDT330X if !DVB_FE_CUSTOMISE
-       select DVB_TUNER_LGH06XF if !DVB_FE_CUSTOMISE
        select DVB_NXT200X if !DVB_FE_CUSTOMISE
        select DVB_CX24123 if !DVB_FE_CUSTOMISE
        select DVB_ISL6421 if !DVB_FE_CUSTOMISE
index 4f556028577037622f80c4eec28fba463ffc8521..07ec81f57cdd0b8d2cbf22d0ddcc6856764b3c12 100644 (file)
@@ -42,7 +42,6 @@
 #include "cx22702.h"
 #include "or51132.h"
 #include "lgdt330x.h"
-#include "lgh06xf.h"
 #include "nxt200x.h"
 #include "cx24123.h"
 #include "isl6421.h"
@@ -631,8 +630,9 @@ static int dvb_register(struct cx8802_dev *dev)
                                               &fusionhdtv_5_gold,
                                               &dev->core->i2c_adap);
                if (dev->dvb.frontend != NULL) {
-                       dvb_attach(lgh06xf_attach, dev->dvb.frontend,
-                                  &dev->core->i2c_adap);
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
+                                  &dev->core->i2c_adap,
+                                  &dvb_pll_lg_tdvs_h06xf);
                }
                }
                break;
@@ -650,8 +650,9 @@ static int dvb_register(struct cx8802_dev *dev)
                                               &pchdtv_hd5500,
                                               &dev->core->i2c_adap);
                if (dev->dvb.frontend != NULL) {
-                       dvb_attach(lgh06xf_attach, dev->dvb.frontend,
-                                  &dev->core->i2c_adap);
+                       dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
+                                  &dev->core->i2c_adap,
+                                  &dvb_pll_lg_tdvs_h06xf);
                }
                }
                break;