summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/at76c651.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 21:47:09 +0100
committerAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 21:47:09 +0100
commit8743017f89633dc04c721dd9f332605aa9e48246 (patch)
treee583883a300e502422b408d6ce79063fd8a6d9a0 /linux/drivers/media/dvb/frontends/at76c651.c
parent0b7b4dd67a96eb2d7e89b62e39266c073a925f3d (diff)
downloadmediapointer-dvb-s2-8743017f89633dc04c721dd9f332605aa9e48246.tar.gz
mediapointer-dvb-s2-8743017f89633dc04c721dd9f332605aa9e48246.tar.bz2
Convert at76c651 to refactored tuner code
From: Andrew de Quincey <adq_dvb@lidskialf.net> Convert to tuner_ops calls. Remove pll function pointers from structure. Remove unneeded tuner calls. Add i2c gate control function. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
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,