diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000-common.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000-common.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000mb.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/dib3000mc.c | 12 |
4 files changed, 22 insertions, 18 deletions
diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.c b/linux/drivers/media/dvb/frontends/dib3000-common.c index 763c549f5..c539eedee 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.c +++ b/linux/drivers/media/dvb/frontends/dib3000-common.c @@ -15,8 +15,8 @@ int dib3000_read_reg(struct dib3000_state *state, u16 reg) u8 wb[] = { ((reg >> 8) | 0x80) & 0xff, reg & 0xff }; u8 rb[2]; struct i2c_msg msg[] = { - { .addr = state->config->demod_address, .flags = 0, .buf = wb, .len = 2 }, - { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = rb, .len = 2 }, + { .addr = state->config.demod_address, .flags = 0, .buf = wb, .len = 2 }, + { .addr = state->config.demod_address, .flags = I2C_M_RD, .buf = rb, .len = 2 }, }; if (i2c_transfer(state->i2c, msg, 2) != 2) @@ -35,7 +35,7 @@ int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val) (val >> 8) & 0xff, val & 0xff, }; struct i2c_msg msg[] = { - { .addr = state->config->demod_address, .flags = 0, .buf = b, .len = 4 } + { .addr = state->config.demod_address, .flags = 0, .buf = b, .len = 4 } }; deb_i2c("writing i2c bus (reg: %5d 0x%04x, val: %5d 0x%04x)\n",reg,reg,val,val); @@ -131,6 +131,10 @@ u16 dib3000_seq[2][2][2] = /* fft,gua, inv */ } }; +MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de"); +MODULE_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb frontend drivers"); +MODULE_LICENSE("GPL"); + EXPORT_SYMBOL(dib3000_seq); EXPORT_SYMBOL(dib3000_read_reg); diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.h b/linux/drivers/media/dvb/frontends/dib3000-common.h index 993f5a8d3..2cd0ad9ab 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.h +++ b/linux/drivers/media/dvb/frontends/dib3000-common.h @@ -49,7 +49,7 @@ struct dib3000_state { struct dvb_frontend_ops ops; /* configuration settings */ - const struct dib3000_config* config; + struct dib3000_config config; spinlock_t pid_list_lock; struct dib3000_pid *pid_list; diff --git a/linux/drivers/media/dvb/frontends/dib3000mb.c b/linux/drivers/media/dvb/frontends/dib3000mb.c index 1cd0aa32c..0131ec4eb 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mb.c +++ b/linux/drivers/media/dvb/frontends/dib3000mb.c @@ -61,10 +61,10 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe, if (tuner) { wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config->pll_addr)); - state->config->pll_set(fe, fep); + 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)); + DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); deb_setf("bandwidth: "); switch (ofdm->bandwidth) { @@ -388,12 +388,12 @@ 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) { + if (state->config.pll_init) { wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config->pll_addr)); - state->config->pll_init(fe); + 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)); + DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); } return 0; @@ -761,8 +761,8 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, goto error; /* setup the state */ - state->config = config; state->i2c = i2c; + memcpy(&state->config,config,sizeof(struct dib3000_config)); memcpy(&state->ops, &dib3000mb_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ diff --git a/linux/drivers/media/dvb/frontends/dib3000mc.c b/linux/drivers/media/dvb/frontends/dib3000mc.c index 2a9de89aa..d395afb73 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc.c +++ b/linux/drivers/media/dvb/frontends/dib3000mc.c @@ -200,10 +200,10 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, if (tuner) { wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config->pll_addr)); - state->config->pll_set(fe, fep); + DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr)); + state->config.pll_set(fe, fep); wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_DISABLE(state->config->pll_addr)); + DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); } dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth); @@ -370,11 +370,11 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); wr(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_PAR_CONT_CLK); wr(DIB3000MC_REG_RST_I2C_ADDR, - DIB3000MC_DEMOD_ADDR(state->config->demod_address) | + DIB3000MC_DEMOD_ADDR(state->config.demod_address) | DIB3000MC_DEMOD_ADDR_ON); wr(DIB3000MC_REG_RST_I2C_ADDR, - DIB3000MC_DEMOD_ADDR(state->config->demod_address)); + DIB3000MC_DEMOD_ADDR(state->config.demod_address)); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_CONFIG); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); @@ -778,8 +778,8 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, goto error; /* setup the state */ - state->config = config; state->i2c = i2c; + memcpy(&state->config,config,sizeof(struct dib3000_config)); memcpy(&state->ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ |