Re: SAA7134 - Pinnacle 3xxi support broken

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 11 May 2006 01:07, Ondrej Zima wrote:
> Andrew de Quincey napsal(a):
> > On Wednesday 10 May 2006 14:16, Ondrej Zima wrote:
> >> Hi all,
> >> I'v checked out the latest source code, compiled it and my Pinnacle 300i
> >> stop to work.
> >> I'm sorry I can't tell which previous version works.
> >> The symptoms are, the DVB is locked but nothing is tuned - signla more
> >> than 60% but snr 0%.
> >> If I use drivers from kernel (2.6.16.12), the tuner working well.
> >> Is there something I must before insmod the saa7134-dvb module? (like
> >> previous behaviour)
> >
> > Thanks for the report, looks like it is my fault. Does the attached patch
> > fix it?
>
> I'm sorry, fix not working :-(
> Still same behaviour. I can provide some debug information about it so
> please tell me how can I get them.
> I must apologize, the symptoms are dvb is *not* locked, nothing is
> tuned, signal is more than 50% and SNR is always 0.

Hi, I'd misunderstood how to program the mt352 on that board - updated patch 
attached.
diff -r 38162695285b linux/drivers/media/dvb/frontends/mt352.c
--- a/linux/drivers/media/dvb/frontends/mt352.c	Tue May 09 10:15:42 2006 -0300
+++ b/linux/drivers/media/dvb/frontends/mt352.c	Thu May 11 09:43:29 2006 +0100
@@ -287,30 +287,22 @@ static int mt352_set_parameters(struct d
 	mt352_calc_nominal_rate(state, op->bandwidth, buf+4);
 	mt352_calc_input_freq(state, buf+6);
 
-	// if there is no secondary tuner, call set_params to set up a potential
-	// tuner attached elsewhere
 	if (state->config.no_tuner) {
 		if (fe->ops->tuner_ops.set_params) {
 			fe->ops->tuner_ops.set_params(fe, param);
-			if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+			if (fe->ops->i2c_gate_ctrl)
+				fe->ops->i2c_gate_ctrl(fe, 0);
 		}
 
-		/* start decoding only */
+		mt352_write(fe, buf, 8);
 		mt352_write(fe, fsm_go, 2);
-	}
-
-	// retrieve the pllbuf - we do this even if there is no
-	// secondary tuner simply so we have a record of what was sent for
-	// debugging.
-	if (fe->ops->tuner_ops.calc_regs) {
-		fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5);
-		buf[8] <<= 1;
-		mt352_write(fe, buf, sizeof(buf));
-	}
-
-	// send PLL and start tuning and then decoding
-	if (!state->config.no_tuner) {
-		mt352_write(fe, tuner_go, 2);
+	} else {
+		if (fe->ops->tuner_ops.calc_regs) {
+			fe->ops->tuner_ops.calc_regs(fe, param, buf+8, 5);
+			buf[8] <<= 1;
+			mt352_write(fe, buf, sizeof(buf));
+			mt352_write(fe, tuner_go, 2);
+		}
 	}
 
 	return 0;
diff -r 38162695285b linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c	Tue May 09 10:15:42 2006 -0300
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c	Thu May 11 09:43:29 2006 +0100
@@ -133,9 +133,8 @@ static int mt352_aver777_init(struct dvb
 	return 0;
 }
 
-static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe,
-				       struct dvb_frontend_parameters* params,
-				       u8* pllbuf, int buf_len)
+static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
+					   struct dvb_frontend_parameters* params)
 {
 	u8 off[] = { 0x00, 0xf1};
 	u8 on[]  = { 0x00, 0x71};
@@ -143,9 +142,6 @@ static int mt352_pinnacle_tuner_calc_reg
 
 	struct saa7134_dev *dev = fe->dvb->priv;
 	struct v4l2_frequency f;
-
-	if (buf_len < 5)
-		return -EINVAL;
 
 	/* set frequency (mt2050) */
 	f.tuner     = 0;
@@ -163,13 +159,7 @@ static int mt352_pinnacle_tuner_calc_reg
 	pinnacle_antenna_pwr(dev, antenna_pwr);
 
 	/* mt352 setup */
-	mt352_pinnacle_init(fe);
-	pllbuf[0] = 0x61;
-	pllbuf[1] = 0x00;
-	pllbuf[2] = 0x00;
-	pllbuf[3] = 0x80;
-	pllbuf[4] = 0x00;
-	return 5;
+	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)
@@ -1026,7 +1016,7 @@ static int dvb_init(struct saa7134_dev *
 		dev->dvb.frontend = mt352_attach(&pinnacle_300i,
 						 &dev->i2c_adap);
 		if (dev->dvb.frontend) {
-			dev->dvb.frontend->ops->tuner_ops.calc_regs = mt352_pinnacle_tuner_calc_regs;
+			dev->dvb.frontend->ops->tuner_ops.set_params = mt352_pinnacle_tuner_set_params;
 		}
 		break;
 
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux