Skip to content

Commit

Permalink
V4L/DVB (4322): Fix dvb-pll autoprobing
Browse files Browse the repository at this point in the history
Trent Piepho pointed out that the pll test i2c transmission is slightly
wrong; it was transmitting a zero length message, and then reading from the
PLL. This was wrong; it should only be transmitting a single read i2c message.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Jul 29, 2006
1 parent 55c05b6 commit 95faba2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/media/dvb/frontends/dvb-pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,17 +614,16 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = {
int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc)
{
u8 b1 [] = { 0 };
struct i2c_msg msg [] = { { .addr = pll_addr, .flags = 0, .buf = NULL, .len = 0 },
{ .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 };
struct dvb_pll_priv *priv = NULL;
int ret;

if (i2c != NULL) {
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);

ret = i2c_transfer (i2c, msg, 2);
if (ret != 2)
ret = i2c_transfer (i2c, &msg, 1);
if (ret != 1)
return -1;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
Expand Down

0 comments on commit 95faba2

Please sign in to comment.