summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/tda80xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/frontends/tda80xx.c')
-rw-r--r--linux/drivers/media/dvb/frontends/tda80xx.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda80xx.c b/linux/drivers/media/dvb/frontends/tda80xx.c
index 051be86b3..7954e8732 100644
--- a/linux/drivers/media/dvb/frontends/tda80xx.c
+++ b/linux/drivers/media/dvb/frontends/tda80xx.c
@@ -523,9 +523,10 @@ static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
{
struct tda80xx_state* state = fe->demodulator_priv;
- tda80xx_writereg(state, 0x1c, 0x80);
- state->config->pll_set(fe, p);
- tda80xx_writereg(state, 0x1c, 0x00);
+ if (fe->ops->tuner_ops->set_params) {
+ fe->ops->tuner_ops->set_params(fe, p);
+ if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
+ }
tda80xx_set_parameters(state, p->inversion, p->u.qpsk.symbol_rate, p->u.qpsk.fec_inner);
tda80xx_set_clk(state);
@@ -628,6 +629,17 @@ static void tda80xx_release(struct dvb_frontend* fe)
kfree(state);
}
+static int tda80xx_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
+{
+ struct tda80xx_state* state = fe->demodulator_priv;
+
+ if (enable) {
+ return tda80xx_writereg(state, 0x1c, 0x80);
+ } else {
+ return tda80xx_writereg(state, 0x1c, 0x00);
+ }
+}
+
static struct dvb_frontend_ops tda80xx_ops;
struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,
@@ -709,6 +721,7 @@ static struct dvb_frontend_ops tda80xx_ops = {
.init = tda80xx_init,
.sleep = tda80xx_sleep,
+ .i2c_gate_ctrl = tda80xx_i2c_gate_ctrl,
.set_frontend = tda80xx_set_frontend,
.get_frontend = tda80xx_get_frontend,