[linux-dvb] PATCH for adequate customization and attachment of dvb-pll.c

Uwe Bugla uwe.bugla at gmx.de
Fri Jun 1 20:08:43 CEST 2007


In current kernel 2.6.22-rc3 the frontend module dvb-pll.c is attached as a generic standard for all bt8xx-based DVB cards. This is no good solution.

Fact is:
The only bt8xx-based card taking advantage of that pll library is the DViCO FusionHDTV Lite 5. All other bt8xx-based DVB cards do not take any advantage of this pll library.

The following patch corrects this problem without breaking any card support.
For further SOBs I do appreciate the relevant persons Cced.

Signed-off-by: Uwe Bugla <uwe.bugla at gmx.de>

--- a/drivers/media/dvb/bt8xx/Kconfig
+++ b/drivers/media/dvb/bt8xx/Kconfig
@@ -7,7 +7,6 @@ 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_PLL
 	select DVB_ZL10353 if !DVB_FE_CUSTOMISE
 	select DVB_DST if !DVB_FE_CUSTOMISE
 	select FW_LOADER
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -279,6 +279,7 @@ config DVB_LGDT330X
 	tristate "LG Electronics LGDT3302/LGDT3303 based"
 	depends on DVB_CORE && I2C
 	default m if DVB_FE_CUSTOMISE
+	select DVB_PLL
 	help
 	  An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
 	  to support this frontend.
@@ -291,8 +292,9 @@
 	depends on DVB_CORE && I2C
 	default m if DVB_FE_CUSTOMISE
 	help
-	  This module driver a number of tuners based on PLL chips with a
-	  common I2C interface. Say Y when you want to support these tuners.
+	  This module driver is needed by a number of tuners based on PLL chips
+	  with a common I2C inferface.
+	  Exceptions are: All bt8xx-based DVB cards except DViCO FusionHDTV 5 Lite.
 
 config DVB_TDA826X
 	tristate "Philips TDA826X silicon tuner"
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -568,24 +568,6 @@ static struct lgdt330x_config
 	.demod_init = digitv_alps_tded4_demod_init,
 };
 
-static struct lgdt330x_config tdvs_tua6034_config = {
-	.demod_address    = 0x0e,
-	.demod_chip       = LGDT3303,
-	.serial_mpeg      = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
-};
-
-static void lgdt330x_reset(struct dvb_bt8xx_card *bt)
-{
-	/* Set pin 27 of the lgdt3303 chip high to reset the frontend */
-
-	/* Pulse the reset line */
-	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
-	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000000); /* Low  */
-	msleep(100);
-
-	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
-	msleep(100);
-}
 
 static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
 {
@@ -606,15 +588,39 @@ case BTTV_BOARD_DVICO
 		}
 		break;
 
+#if defined(CONFIG_DVB_LGDT330x)
+static struct lgdt330x_config tdvs_tua6034_config = {
+	.demod_address    = 0x0e,
+	.demod_chip       = LGDT3303,
+	.serial_mpeg      = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
+};
+
+static void lgdt330x_reset(struct dvb_bt8xx_card *bt)
+{
+	/* Set pin 27 of the lgdt3303 chip high to reset the frontend */
+
+	/* Pulse the reset line */
+	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
+	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000000); /* Low  */
+	msleep(100);
+
+	bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
+	msleep(100);
+}
+
 	case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE:
 		lgdt330x_reset(card);
 		card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter);
 		if (card->fe != NULL) {
 			dvb_attach(dvb_pll_attach, card->fe, 0x61,
 				   card->i2c_adapter, &dvb_pll_lg_tdvs_h06xf);
 			dprintk ("dvb_bt8xx: lgdt330x detected\n");
 		}
 		break;
+#else
+ printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
+ return NULL;
+#endif // CONFIG_DVB_LGDT330x //
 
 	case BTTV_BOARD_NEBULA_DIGITV:
 		/*

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pll.patch
Type: text/x-diff
Size: 3211 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070601/1a33f0b1/attachment.patch 


More information about the linux-dvb mailing list