summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/av7110.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index cc646721d..418fc6438 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1650,6 +1650,8 @@ static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x63, .flags = 0, .buf = data, .len = sizeof(data) };
+ struct i2c_msg readmsg = { .addr = 0x63, .flags = I2C_M_RD, .buf = data, .len = 1 };
+ int i;
// this calculation does not match the TDA6405TS datasheet!
div = (params->frequency + 36150000) / 62500;
@@ -1675,7 +1677,15 @@ static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_
return -EIO;
}
- msleep(20);
+ // wait for PLL lock
+ for(i=0; i< 20; i++) {
+
+ stv0297_enable_plli2c(fe);
+ if (i2c_transfer (&av7110->i2c_adap, &readmsg, 1) == 1)
+ if (data[0] & 0x40) break;
+ msleep(10);
+ }
+
return 0;
}