summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/at76c651.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/frontends/at76c651.c')
-rw-r--r--linux/drivers/media/dvb/frontends/at76c651.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c
index ddcb99cc5..556689a80 100644
--- a/linux/drivers/media/dvb/frontends/at76c651.c
+++ b/linux/drivers/media/dvb/frontends/at76c651.c
@@ -246,9 +246,10 @@ static int at76c651_set_parameters(struct dvb_frontend* fe,
int ret;
struct at76c651_state* state = fe->demodulator_priv;
- at76c651_writereg(state, 0x0c, 0xc3);
- state->config->pll_set(fe, p);
- at76c651_writereg(state, 0x0c, 0xc2);
+ 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);
+ }
if ((ret = at76c651_set_symbol_rate(state, p->u.qam.symbol_rate)))
return ret;
@@ -268,12 +269,6 @@ static int at76c651_set_defaults(struct dvb_frontend* fe)
at76c651_set_bbfreq(state);
at76c651_set_auto_config(state);
- if (state->config->pll_init) {
- at76c651_writereg(state, 0x0c, 0xc3);
- state->config->pll_init(fe);
- at76c651_writereg(state, 0x0c, 0xc2);
- }
-
return 0;
}
@@ -344,6 +339,17 @@ static int at76c651_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
return 0;
}
+static int at76c651_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
+{
+ struct at76c651_state* state = fe->demodulator_priv;
+
+ if (enable) {
+ return at76c651_writereg(state, 0x0c, 0xc3);
+ } else {
+ return at76c651_writereg(state, 0x0c, 0xc2);
+ }
+}
+
static int at76c651_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *fesettings)
{
fesettings->min_delay_ms = 50;
@@ -414,6 +420,7 @@ static struct dvb_frontend_ops at76c651_ops = {
.release = at76c651_release,
.init = at76c651_set_defaults,
+ .i2c_gate_ctrl = at76c651_i2c_gate_ctrl,
.set_frontend = at76c651_set_parameters,
.get_tune_settings = at76c651_get_tune_settings,