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.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda80xx.c b/linux/drivers/media/dvb/frontends/tda80xx.c
index 051be86b3..996fd4beb 100644
--- a/linux/drivers/media/dvb/frontends/tda80xx.c
+++ b/linux/drivers/media/dvb/frontends/tda80xx.c
@@ -46,8 +46,6 @@ struct tda80xx_state {
struct i2c_adapter* i2c;
- struct dvb_frontend_ops ops;
-
/* configuration settings */
const struct tda80xx_config* config;
@@ -523,9 +521,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 +627,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,
@@ -643,7 +653,6 @@ struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,
/* setup the state */
state->config = config;
state->i2c = i2c;
- memcpy(&state->ops, &tda80xx_ops, sizeof(struct dvb_frontend_ops));
state->spectral_inversion = INVERSION_AUTO;
state->code_rate = FEC_AUTO;
state->status = 0;
@@ -678,7 +687,7 @@ struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,
}
/* create dvb_frontend */
- state->frontend.ops = &state->ops;
+ memcpy(&state->frontend.ops, &tda80xx_ops, sizeof(struct dvb_frontend_ops));
state->frontend.demodulator_priv = state;
return &state->frontend;
@@ -709,6 +718,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,