summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 21:47:10 +0100
committerAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 21:47:10 +0100
commit079b0dc26bb807e48641259c368379da67df640b (patch)
tree6ea668e49a0d265892133610385dc25fc3b8eec4 /linux/drivers/media/dvb/frontends
parentf9378e87cce2131f14020bac98334a1c92d71c83 (diff)
downloadmediapointer-dvb-s2-079b0dc26bb807e48641259c368379da67df640b.tar.gz
mediapointer-dvb-s2-079b0dc26bb807e48641259c368379da67df640b.tar.bz2
Convert tda80xx 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')
-rw-r--r--linux/drivers/media/dvb/frontends/tda80xx.c19
-rw-r--r--linux/drivers/media/dvb/frontends/tda80xx.h4
2 files changed, 16 insertions, 7 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,
diff --git a/linux/drivers/media/dvb/frontends/tda80xx.h b/linux/drivers/media/dvb/frontends/tda80xx.h
index cd639a0aa..435dd9477 100644
--- a/linux/drivers/media/dvb/frontends/tda80xx.h
+++ b/linux/drivers/media/dvb/frontends/tda80xx.h
@@ -39,10 +39,6 @@ struct tda80xx_config
/* Register setting to use for 18v */
u8 volt18setting;
-
- /* PLL maintenance */
- int (*pll_init)(struct dvb_frontend* fe);
- int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
};
extern struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config,