Re: Re: TDA8290/TDA8275 with LNA

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

 



Hi, Nico

I found a bug in the tda827x module. A buffer was one byte too short.
This might have been the cause of the crashes since the trouble started
after the first tuning attempt and the bug was in the tuning function.
So may i ask you to apply the attached patch or to pull from my personal
repository at
http://linuxtv.org/hg/~hhackmann/v4l-dvb

Sorry for the inconvenience
   Hartmut
# HG changeset patch
# User Hartmut Hackmann <hartmut.hackmann@xxxxxxxxxxx>
# Date Tue Feb 27 22:18:52 2007 +0100
# Node ID 3116942ce085558a27e0bd51e0958275bb757af6
# parent: 065567ae3ae076caa8b08deedb80df2e305da8ec
Fixed 1 byte too short buffer in tda827x.c

From: Hartmut Hackmann <hartmut.hackmann@xxxxxxxxxxx>

- The i2c data buffer in tda827xa_set_params was 1 byte too short
- saa7134-dvb now gives an error mesage if tda827x could not be attached
- coding style fix in tda1004x.c

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@xxxxxxxxxxx>

--- a/linux/drivers/media/dvb/frontends/tda1004x.c	Sun Feb 25 10:09:33 2007 -0200
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c	Tue Feb 27 22:18:52 2007 +0100
@@ -695,7 +695,8 @@ static int tda1004x_set_fe(struct dvb_fr
 	// set frequency
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe, fe_params);
-		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);
 	}
 
 	// Hardcoded to use auto as much as possible on the TDA10045 as it
--- a/linux/drivers/media/dvb/frontends/tda827x.c	Sun Feb 25 10:09:33 2007 -0200
+++ b/linux/drivers/media/dvb/frontends/tda827x.c	Tue Feb 27 22:18:52 2007 +0100
@@ -214,7 +214,7 @@ static int tda827xa_set_params(struct dv
 			       struct dvb_frontend_parameters *params)
 {
 	struct tda827x_priv *priv = fe->tuner_priv;
-	u8 buf[10];
+	u8 buf[11];
 
 	struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
 			       .buf = buf, .len = sizeof(buf) };
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c	Sun Feb 25 10:09:33 2007 -0200
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c	Tue Feb 27 22:18:52 2007 +0100
@@ -693,8 +693,11 @@ static void configure_tda827x_fe(struct 
 	if (dev->dvb.frontend) {
 		if (tda_conf->i2c_gate)
 			dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
-		dvb_attach(tda827x_attach,dev->dvb.frontend,
-			   tda_conf->tuner_address,&dev->i2c_adap,&tda827x_cfg);
+		if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address,
+						&dev->i2c_adap,&tda827x_cfg) == NULL) {
+			printk ("saa7134/dvb: no tda827x tuner found at addr: %02x\n",
+				tda_conf->tuner_address);
+		}
 	}
 }
 
@@ -1039,9 +1042,12 @@ static int dvb_init(struct saa7134_dev *
 					       &ads_tech_duo_config,
 					       &dev->i2c_adap);
 		if (dev->dvb.frontend) {
-			dvb_attach(tda827x_attach,dev->dvb.frontend,
+			if (dvb_attach(tda827x_attach,dev->dvb.frontend,
 				   ads_tech_duo_config.tuner_address,
-				   &dev->i2c_adap,&ads_duo_cfg);
+				   &dev->i2c_adap,&ads_duo_cfg) == NULL) {
+				printk ("saa7134/dvb: no tda827x tuner found at addr: %02x\n",
+					ads_tech_duo_config.tuner_address);
+			}
 		}
 		break;
 	case SAA7134_BOARD_TEVION_DVBT_220RF:

_______________________________________________
linux-dvb mailing list
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