[linux-dvb] Pinnacle 300i, please try this patch

Hartmut Hackmann hartmut.hackmann at t-online.de
Sun Feb 12 21:32:08 CET 2006


Hi, folks

I worked a bit on the Pinnacle PCTV 300i and i think i got it
fully working now.
A remaining problem is that the tda9887.ko module needs to be
loaded before tuner.ko. The reason seems to be the tda8290 probing
code wich seems to be harmful only for the pinnacle cards.

Please try the patch and report whether it works for you.

Best regards
   Hartmut
-------------- next part --------------
diff -uNr v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c v4l-dvb.new/linux/drivers/media/video/saa7134/saa7134-cards.c
--- v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c	2006-02-05 23:30:23.000000000 +0100
+++ v4l-dvb.new/linux/drivers/media/video/saa7134/saa7134-cards.c	2006-02-12 02:25:02.000000000 +0100
@@ -979,7 +979,7 @@
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE,
+		.tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
 		.inputs         = {{
 			.name = name_tv,
 			.vmux = 3,
@@ -1668,7 +1668,7 @@
 		.radio_type     = UNSET,
 		.tuner_addr	= ADDR_UNSET,
 		.radio_addr	= ADDR_UNSET,
-		.tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE,
+		.tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
 		.mpeg           = SAA7134_MPEG_DVB,
 		.inputs         = {{
 			.name = name_tv,
diff -uNr v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c v4l-dvb.new/linux/drivers/media/video/saa7134/saa7134-dvb.c
--- v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c	2006-02-05 23:24:48.000000000 +0100
+++ v4l-dvb.new/linux/drivers/media/video/saa7134/saa7134-dvb.c	2006-02-12 03:02:21.000000000 +0100
@@ -112,6 +112,10 @@
 	mt352_write(fe, fsm_ctl_cfg,    sizeof(fsm_ctl_cfg));
 	mt352_write(fe, scan_ctl_cfg,   sizeof(scan_ctl_cfg));
 	mt352_write(fe, irq_cfg,        sizeof(irq_cfg));
+
+	/* this turns the remote control chip off to work around a bug in it */
+	saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
+	saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
 	return 0;
 }
 
@@ -137,8 +141,10 @@
 				  struct dvb_frontend_parameters* params,
 				  u8* pllbuf)
 {
-	static int on  = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE;
-	static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE;
+	u8 off[] = { 0x00, 0xf1};
+	u8 on[]  = { 0x00, 0x71};
+	struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
+
 	struct saa7134_dev *dev = fe->dvb->priv;
 	struct v4l2_frequency f;
 
@@ -146,9 +152,10 @@
 	f.tuner     = 0;
 	f.type      = V4L2_TUNER_DIGITAL_TV;
 	f.frequency = params->frequency / 1000 * 16 / 1000;
-	saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on);
+	i2c_transfer(&dev->i2c_adap, &msg, 1);
 	saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
-	saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off);
+	msg.buf = on;
+	i2c_transfer(&dev->i2c_adap, &msg, 1);
 
 	pinnacle_antenna_pwr(dev, antenna_pwr);
 
diff -uNr v4l-dvb/linux/drivers/media/video/tuner-core.c v4l-dvb.new/linux/drivers/media/video/tuner-core.c
--- v4l-dvb/linux/drivers/media/video/tuner-core.c	2006-02-02 23:40:38.000000000 +0100
+++ v4l-dvb.new/linux/drivers/media/video/tuner-core.c	2006-02-12 01:40:13.000000000 +0100
@@ -768,8 +768,9 @@
 			struct v4l2_frequency *f = arg;
 
 			switch_v4l2();
-			if (V4L2_TUNER_RADIO == f->type &&
-			    V4L2_TUNER_RADIO != t->mode) {
+			if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
+				|| (V4L2_TUNER_DIGITAL_TV == f->type 
+					&& V4L2_TUNER_DIGITAL_TV != t->mode)) {
 				if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
 					    == EINVAL)
 					return 0;


More information about the linux-dvb mailing list