diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2006-05-22 09:31:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:59:52 -0400 |
commit | a9686e0d204e3faa544434c709ccb599f8165252 (patch) | |
tree | 5641cf2bd9a5c4e4f4fec7fd0214b207a5277f25 /drivers/media | |
parent | ebfbc305bda90deadf73898493c707cce3b465e6 (diff) |
V4L/DVB (3935): Add missing pll gate control calls
I'd missed some of these out, breaking the av7110 tuning. I then checked for
more and added them in where necessary. They may not actually be necessary
in all these locations, but if not, they'll simply have no effect.
Add small delay to stv0299 pll gate control to fix tuning problems.
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/bsbe1.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/bsru6.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/lg_h06xf.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv0299.c | 6 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 14 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 4 |
6 files changed, 30 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/bsbe1.h b/drivers/media/dvb/frontends/bsbe1.h index 6b52d5abf19f..b2aeddb14e16 100644 --- a/drivers/media/dvb/frontends/bsbe1.h +++ b/drivers/media/dvb/frontends/bsbe1.h | |||
@@ -106,6 +106,8 @@ static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe, struct dvb_front | |||
106 | data[2] = 0x80 | ((div & 0x18000) >> 10) | 4; | 106 | data[2] = 0x80 | ((div & 0x18000) >> 10) | 4; |
107 | data[3] = (params->frequency > 1530000) ? 0xE0 : 0xE4; | 107 | data[3] = (params->frequency > 1530000) ? 0xE0 : 0xE4; |
108 | 108 | ||
109 | if (fe->ops->i2c_gate_ctrl) | ||
110 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
109 | ret = i2c_transfer(i2c, &msg, 1); | 111 | ret = i2c_transfer(i2c, &msg, 1); |
110 | return (ret != 1) ? -EIO : 0; | 112 | return (ret != 1) ? -EIO : 0; |
111 | } | 113 | } |
diff --git a/drivers/media/dvb/frontends/bsru6.h b/drivers/media/dvb/frontends/bsru6.h index 5d13c5e4df64..5533512b04c6 100644 --- a/drivers/media/dvb/frontends/bsru6.h +++ b/drivers/media/dvb/frontends/bsru6.h | |||
@@ -120,6 +120,8 @@ static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe, struct dvb_front | |||
120 | if (params->frequency > 1530000) | 120 | if (params->frequency > 1530000) |
121 | buf[3] = 0xc0; | 121 | buf[3] = 0xc0; |
122 | 122 | ||
123 | if (fe->ops->i2c_gate_ctrl) | ||
124 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
123 | if (i2c_transfer(i2c, &msg, 1) != 1) | 125 | if (i2c_transfer(i2c, &msg, 1) != 1) |
124 | return -EIO; | 126 | return -EIO; |
125 | return 0; | 127 | return 0; |
diff --git a/drivers/media/dvb/frontends/lg_h06xf.h b/drivers/media/dvb/frontends/lg_h06xf.h index d8449f8cff71..c59fe4180522 100644 --- a/drivers/media/dvb/frontends/lg_h06xf.h +++ b/drivers/media/dvb/frontends/lg_h06xf.h | |||
@@ -29,6 +29,8 @@ static int lg_h06xf_pll_set(struct dvb_frontend* fe, struct i2c_adapter* i2c_ada | |||
29 | int err; | 29 | int err; |
30 | 30 | ||
31 | dvb_pll_configure(&dvb_pll_lg_tdvs_h06xf, buf, params->frequency, 0); | 31 | dvb_pll_configure(&dvb_pll_lg_tdvs_h06xf, buf, params->frequency, 0); |
32 | if (fe->ops->i2c_gate_ctrl) | ||
33 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
32 | if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { | 34 | if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { |
33 | printk(KERN_WARNING "lg_h06xf: %s error " | 35 | printk(KERN_WARNING "lg_h06xf: %s error " |
34 | "(addr %02x <- %02x, err = %i)\n", | 36 | "(addr %02x <- %02x, err = %i)\n", |
@@ -45,6 +47,8 @@ static int lg_h06xf_pll_set(struct dvb_frontend* fe, struct i2c_adapter* i2c_ada | |||
45 | buf[0] |= 0x18; | 47 | buf[0] |= 0x18; |
46 | buf[1] = 0x50; | 48 | buf[1] = 0x50; |
47 | msg.len = 2; | 49 | msg.len = 2; |
50 | if (fe->ops->i2c_gate_ctrl) | ||
51 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
48 | if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { | 52 | if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) { |
49 | printk(KERN_WARNING "lg_h06xf: %s error " | 53 | printk(KERN_WARNING "lg_h06xf: %s error " |
50 | "(addr %02x <- %02x, err = %i)\n", | 54 | "(addr %02x <- %02x, err = %i)\n", |
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c index 5a81310235a4..e91bb5842dc4 100644 --- a/drivers/media/dvb/frontends/stv0299.c +++ b/drivers/media/dvb/frontends/stv0299.c | |||
@@ -604,10 +604,12 @@ static int stv0299_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | |||
604 | struct stv0299_state* state = fe->demodulator_priv; | 604 | struct stv0299_state* state = fe->demodulator_priv; |
605 | 605 | ||
606 | if (enable) { | 606 | if (enable) { |
607 | return stv0299_writeregI(state, 0x05, 0xb5); | 607 | stv0299_writeregI(state, 0x05, 0xb5); |
608 | } else { | 608 | } else { |
609 | return stv0299_writeregI(state, 0x05, 0x35); | 609 | stv0299_writeregI(state, 0x05, 0x35); |
610 | } | 610 | } |
611 | udelay(1); | ||
612 | return 0; | ||
611 | } | 613 | } |
612 | 614 | ||
613 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) | 615 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) |
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index cf264512d36f..e540dacf5ce2 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1039,6 +1039,8 @@ static int alps_tdmb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_front | |||
1039 | data[2] = ((div >> 10) & 0x60) | 0x85; | 1039 | data[2] = ((div >> 10) & 0x60) | 0x85; |
1040 | data[3] = params->frequency < 592000000 ? 0x40 : 0x80; | 1040 | data[3] = params->frequency < 592000000 ? 0x40 : 0x80; |
1041 | 1041 | ||
1042 | if (fe->ops->i2c_gate_ctrl) | ||
1043 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1042 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO; | 1044 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO; |
1043 | return 0; | 1045 | return 0; |
1044 | } | 1046 | } |
@@ -1059,6 +1061,8 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe) | |||
1059 | struct i2c_msg tuner_msg = { .addr=0x60, .flags=0, .buf=td1316_init, .len=sizeof(td1316_init) }; | 1061 | struct i2c_msg tuner_msg = { .addr=0x60, .flags=0, .buf=td1316_init, .len=sizeof(td1316_init) }; |
1060 | 1062 | ||
1061 | // setup PLL configuration | 1063 | // setup PLL configuration |
1064 | if (fe->ops->i2c_gate_ctrl) | ||
1065 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1062 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; | 1066 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; |
1063 | msleep(1); | 1067 | msleep(1); |
1064 | 1068 | ||
@@ -1066,6 +1070,8 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe) | |||
1066 | tuner_msg.addr = 0x65; | 1070 | tuner_msg.addr = 0x65; |
1067 | tuner_msg.buf = disable_mc44BC374c; | 1071 | tuner_msg.buf = disable_mc44BC374c; |
1068 | tuner_msg.len = sizeof(disable_mc44BC374c); | 1072 | tuner_msg.len = sizeof(disable_mc44BC374c); |
1073 | if (fe->ops->i2c_gate_ctrl) | ||
1074 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1069 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { | 1075 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { |
1070 | i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1); | 1076 | i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1); |
1071 | } | 1077 | } |
@@ -1133,6 +1139,8 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb | |||
1133 | tuner_buf[2] = 0xca; | 1139 | tuner_buf[2] = 0xca; |
1134 | tuner_buf[3] = (cp << 5) | (filter << 3) | band; | 1140 | tuner_buf[3] = (cp << 5) | (filter << 3) | band; |
1135 | 1141 | ||
1142 | if (fe->ops->i2c_gate_ctrl) | ||
1143 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1136 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) | 1144 | if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) |
1137 | return -EIO; | 1145 | return -EIO; |
1138 | 1146 | ||
@@ -1296,6 +1304,8 @@ static int philips_tsa5059_tuner_set_params(struct dvb_frontend *fe, struct dvb_ | |||
1296 | if (ttusb->revision == TTUSB_REV_2_2) | 1304 | if (ttusb->revision == TTUSB_REV_2_2) |
1297 | buf[3] |= 0x20; | 1305 | buf[3] |= 0x20; |
1298 | 1306 | ||
1307 | if (fe->ops->i2c_gate_ctrl) | ||
1308 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1299 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) | 1309 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) |
1300 | return -EIO; | 1310 | return -EIO; |
1301 | 1311 | ||
@@ -1328,6 +1338,8 @@ static int ttusb_novas_grundig_29504_491_tuner_set_params(struct dvb_frontend *f | |||
1328 | buf[2] = 0x8e; | 1338 | buf[2] = 0x8e; |
1329 | buf[3] = 0x00; | 1339 | buf[3] = 0x00; |
1330 | 1340 | ||
1341 | if (fe->ops->i2c_gate_ctrl) | ||
1342 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1331 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) | 1343 | if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) |
1332 | return -EIO; | 1344 | return -EIO; |
1333 | 1345 | ||
@@ -1353,6 +1365,8 @@ static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_front | |||
1353 | data[2] = 0x85 | ((div >> 10) & 0x60); | 1365 | data[2] = 0x85 | ((div >> 10) & 0x60); |
1354 | data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81); | 1366 | data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81); |
1355 | 1367 | ||
1368 | if (fe->ops->i2c_gate_ctrl) | ||
1369 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
1356 | if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1) | 1370 | if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1) |
1357 | return -EIO; | 1371 | return -EIO; |
1358 | 1372 | ||
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index a83db2abb449..f2b155a2299d 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -150,9 +150,13 @@ static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe, | |||
150 | f.tuner = 0; | 150 | f.tuner = 0; |
151 | f.type = V4L2_TUNER_DIGITAL_TV; | 151 | f.type = V4L2_TUNER_DIGITAL_TV; |
152 | f.frequency = params->frequency / 1000 * 16 / 1000; | 152 | f.frequency = params->frequency / 1000 * 16 / 1000; |
153 | if (fe->ops->i2c_gate_ctrl) | ||
154 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
153 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 155 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
154 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); | 156 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); |
155 | msg.buf = on; | 157 | msg.buf = on; |
158 | if (fe->ops->i2c_gate_ctrl) | ||
159 | fe->ops->i2c_gate_ctrl(fe, 1); | ||
156 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 160 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
157 | 161 | ||
158 | pinnacle_antenna_pwr(dev, antenna_pwr); | 162 | pinnacle_antenna_pwr(dev, antenna_pwr); |