summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/dib3000mb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/frontends/dib3000mb.c')
-rw-r--r--linux/drivers/media/dvb/frontends/dib3000mb.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/frontends/dib3000mb.c b/linux/drivers/media/dvb/frontends/dib3000mb.c
index ec076cd4b..5caaed1ee 100644
--- a/linux/drivers/media/dvb/frontends/dib3000mb.c
+++ b/linux/drivers/media/dvb/frontends/dib3000mb.c
@@ -2,7 +2,7 @@
* Frontend driver for mobile DVB-T demodulator DiBcom 3000-MB
* DiBcom (http://www.dibcom.fr/)
*
- * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de)
+ * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
*
* based on GPL code from DibCom, which has
*
@@ -47,6 +47,8 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-a
#define deb_setf(args...) dprintk(0x04,args)
#define deb_getf(args...) dprintk(0x08,args)
+static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr);
+
static int dib3000mb_get_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters *fep);
@@ -59,11 +61,9 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
int search_state, seq;
if (tuner) {
- wr(DIB3000MB_REG_TUNER,
- DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr));
- state->config.pll_set(fe, fep);
- wr(DIB3000MB_REG_TUNER,
- DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr));
+ dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
+ state->config.pll_set(fe, fep, NULL);
+ dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
deb_setf("bandwidth: ");
switch (ofdm->bandwidth) {
@@ -388,11 +388,9 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
wr(DIB3000MB_REG_DATA_IN_DIVERSITY, DIB3000MB_DATA_DIVERSITY_IN_OFF);
if (state->config.pll_init) {
- wr(DIB3000MB_REG_TUNER,
- DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr));
- state->config.pll_init(fe);
- wr(DIB3000MB_REG_TUNER,
- DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr));
+ dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe));
+ state->config.pll_init(fe,NULL);
+ dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
}
return 0;
@@ -749,6 +747,17 @@ static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff)
return 0;
}
+static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr)
+{
+ struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv;
+ if (onoff) {
+ wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr));
+ } else {
+ wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_DISABLE(pll_addr));
+ }
+ return 0;
+}
+
static struct dvb_frontend_ops dib3000mb_ops;
struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
@@ -784,6 +793,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config,
xfer_ops->pid_parse = dib3000mb_pid_parse;
xfer_ops->fifo_ctrl = dib3000mb_fifo_control;
xfer_ops->pid_ctrl = dib3000mb_pid_control;
+ xfer_ops->tuner_pass_ctrl = dib3000mb_tuner_pass_ctrl;
return &state->frontend;