make dvb-pll probe for device presence

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

 



Hi - heres that idea we talked about a week or so back - it makes dvb-pll 
check for an i2c device's presence before going any further.

wdyt? (this isn't a proper committable patch yet BTW; no signed off by etc)
diff -r 676364f7622d linux/drivers/media/dvb/frontends/dvb-pll.c
--- a/linux/drivers/media/dvb/frontends/dvb-pll.c	Tue Jun 20 00:30:57 2006 -0300
+++ b/linux/drivers/media/dvb/frontends/dvb-pll.c	Tue Jun 20 09:28:48 2006 +0100
@@ -615,6 +615,20 @@ int dvb_pll_attach(struct dvb_frontend *
 {
 	struct dvb_pll_priv *priv = NULL;
 
+	if (fe->ops.i2c_gate_ctrl)
+		fe->ops.i2c_gate_ctrl(fe, 1);
+	if (i2c_smbus_xfer(i2c, pll_addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0)
+		return -1;
+
+	/* prevent 24RF08 corruption */
+	if ((pll_addr & ~0x0f) == 0x50) {
+		if (fe->ops.i2c_gate_ctrl)
+			fe->ops.i2c_gate_ctrl(fe, 1);
+		i2c_smbus_xfer(i2c, pll_addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL);
+	}
+        if (fe->ops.i2c_gate_ctrl)
+                     fe->ops.i2c_gate_ctrl(fe, 0);
+
 	priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL);
 	if (priv == NULL)
 		return -ENOMEM;
_______________________________________________

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