summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-28 01:47:05 +0100
committerAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-28 01:47:05 +0100
commitab12813a48c3dbc4f0d9f2b3e93e7a5465744f9c (patch)
tree5900abd2a636033c3d56115cdaaefbfa314cf63e
parenta8030bb8f293d1eba3527eba4f91543aa9a48a0d (diff)
downloadmediapointer-dvb-s2-ab12813a48c3dbc4f0d9f2b3e93e7a5465744f9c.tar.gz
mediapointer-dvb-s2-ab12813a48c3dbc4f0d9f2b3e93e7a5465744f9c.tar.bz2
Add missing pll gate control calls
From: Andrew de Quincey <adq_dvb@lidskialf.net> 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>
-rw-r--r--linux/drivers/media/dvb/frontends/bsbe1.h2
-rw-r--r--linux/drivers/media/dvb/frontends/bsru6.h2
-rw-r--r--linux/drivers/media/dvb/frontends/lg_h06xf.h4
-rw-r--r--linux/drivers/media/dvb/frontends/stv0299.c6
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c14
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c4
6 files changed, 30 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/bsbe1.h b/linux/drivers/media/dvb/frontends/bsbe1.h
index 6b52d5abf..b2aeddb14 100644
--- a/linux/drivers/media/dvb/frontends/bsbe1.h
+++ b/linux/drivers/media/dvb/frontends/bsbe1.h
@@ -106,6 +106,8 @@ static int alps_bsbe1_tuner_set_params(struct dvb_frontend* fe, struct dvb_front
data[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
data[3] = (params->frequency > 1530000) ? 0xE0 : 0xE4;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
ret = i2c_transfer(i2c, &msg, 1);
return (ret != 1) ? -EIO : 0;
}
diff --git a/linux/drivers/media/dvb/frontends/bsru6.h b/linux/drivers/media/dvb/frontends/bsru6.h
index 5d13c5e4d..5533512b0 100644
--- a/linux/drivers/media/dvb/frontends/bsru6.h
+++ b/linux/drivers/media/dvb/frontends/bsru6.h
@@ -120,6 +120,8 @@ static int alps_bsru6_tuner_set_params(struct dvb_frontend *fe, struct dvb_front
if (params->frequency > 1530000)
buf[3] = 0xc0;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(i2c, &msg, 1) != 1)
return -EIO;
return 0;
diff --git a/linux/drivers/media/dvb/frontends/lg_h06xf.h b/linux/drivers/media/dvb/frontends/lg_h06xf.h
index 6869cbd03..21acb5bad 100644
--- a/linux/drivers/media/dvb/frontends/lg_h06xf.h
+++ b/linux/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
int err;
dvb_pll_configure(&dvb_pll_lg_tdvs_h06xf, buf, params->frequency, 0);
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) {
printk(KERN_WARNING "lg_h06xf: %s error "
"(addr %02x <- %02x, err = %i)\n",
@@ -51,6 +53,8 @@ static int lg_h06xf_pll_set(struct dvb_frontend* fe, struct i2c_adapter* i2c_ada
buf[1] = 0x50;
msg.len = 2;
#endif
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if ((err = i2c_transfer(i2c_adap, &msg, 1)) != 1) {
printk(KERN_WARNING "lg_h06xf: %s error "
"(addr %02x <- %02x, err = %i)\n",
diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c
index 5a8131023..e91bb5842 100644
--- a/linux/drivers/media/dvb/frontends/stv0299.c
+++ b/linux/drivers/media/dvb/frontends/stv0299.c
@@ -604,10 +604,12 @@ static int stv0299_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
struct stv0299_state* state = fe->demodulator_priv;
if (enable) {
- return stv0299_writeregI(state, 0x05, 0xb5);
+ stv0299_writeregI(state, 0x05, 0xb5);
} else {
- return stv0299_writeregI(state, 0x05, 0x35);
+ stv0299_writeregI(state, 0x05, 0x35);
}
+ udelay(1);
+ return 0;
}
static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 30c26a867..af1631a25 100644
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1047,6 +1047,8 @@ static int alps_tdmb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_front
data[2] = ((div >> 10) & 0x60) | 0x85;
data[3] = params->frequency < 592000000 ? 0x40 : 0x80;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO;
return 0;
}
@@ -1067,6 +1069,8 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe)
struct i2c_msg tuner_msg = { .addr=0x60, .flags=0, .buf=td1316_init, .len=sizeof(td1316_init) };
// setup PLL configuration
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO;
msleep(1);
@@ -1074,6 +1078,8 @@ static int philips_tdm1316l_tuner_init(struct dvb_frontend* fe)
tuner_msg.addr = 0x65;
tuner_msg.buf = disable_mc44BC374c;
tuner_msg.len = sizeof(disable_mc44BC374c);
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) {
i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1);
}
@@ -1141,6 +1147,8 @@ static int philips_tdm1316l_tuner_set_params(struct dvb_frontend* fe, struct dvb
tuner_buf[2] = 0xca;
tuner_buf[3] = (cp << 5) | (filter << 3) | band;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1)
return -EIO;
@@ -1304,6 +1312,8 @@ static int philips_tsa5059_tuner_set_params(struct dvb_frontend *fe, struct dvb_
if (ttusb->revision == TTUSB_REV_2_2)
buf[3] |= 0x20;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1)
return -EIO;
@@ -1336,6 +1346,8 @@ static int ttusb_novas_grundig_29504_491_tuner_set_params(struct dvb_frontend *f
buf[2] = 0x8e;
buf[3] = 0x00;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1)
return -EIO;
@@ -1361,6 +1373,8 @@ static int alps_tdbe2_tuner_set_params(struct dvb_frontend* fe, struct dvb_front
data[2] = 0x85 | ((div >> 10) & 0x60);
data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1)
return -EIO;
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index b659b96e5..ea0a1290d 100644
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -151,9 +151,13 @@ static int mt352_pinnacle_tuner_calc_regs(struct dvb_frontend* fe,
f.tuner = 0;
f.type = V4L2_TUNER_DIGITAL_TV;
f.frequency = params->frequency / 1000 * 16 / 1000;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
i2c_transfer(&dev->i2c_adap, &msg, 1);
saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
msg.buf = on;
+ if (fe->ops->i2c_gate_ctrl)
+ fe->ops->i2c_gate_ctrl(fe, 1);
i2c_transfer(&dev->i2c_adap, &msg, 1);
pinnacle_antenna_pwr(dev, antenna_pwr);