diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-09 15:50:44 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-09 15:50:44 +0000 |
commit | ff21bded4892d260edde81df8e8f108aa229c7fc (patch) | |
tree | 8c41925392ce0aa76a48c0b973569af877414ff8 /linux/drivers/media/dvb/frontends/dib3000mb.c | |
parent | 9b432f78f4e082705fe90c5d8885d9f7ced755d0 (diff) | |
download | mediapointer-dvb-s2-ff21bded4892d260edde81df8e8f108aa229c7fc.tar.gz mediapointer-dvb-s2-ff21bded4892d260edde81df8e8f108aa229c7fc.tar.bz2 |
internal refactoring step 3/3
- added tuner and demod types for easier extension of new devices
- added a check for some artec devices which have another tuner
onboard, but don't know it, pll_addr is now a callback because of that
- general callbacks for pll_set, pll_init and demod_init. They decide which
pll-programming function is used and so on
- added tuner passthru callback to xfer_ops. now dibusb can en/disable the
tuner passthru of the dib3000m*-frontends; necessary for tuner probing
- remote type determination (no for hanftek, nec for others), was not planned
- fixed a bug in start_feed, which was introduced in step 2/3 but wasn't critical
- added pll-programming for lg_tdtp_e102p_tua6034 (it has the tua6034 as pll)
- added pll-programming and initialization for PANASONIC ENV77H11D5
- understood the i2c-address problem, now it is more logical
Diffstat (limited to 'linux/drivers/media/dvb/frontends/dib3000mb.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000mb.c | 32 |
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; |