diff options
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
30 files changed, 243 insertions, 537 deletions
diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index 812d814dc..861876791 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -255,14 +255,6 @@ static int at76c651_set_inversion(struct at76c651_state* state, fe_spectral_inve return at76c651_writereg(state, 0x60, feciqinv); } - - - - - - - - static int at76c651_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { @@ -355,7 +347,6 @@ static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr) ((at76c651_readreg(state, 0x8F) << 8) | at76c651_readreg(state, 0x90)); - return 0; } diff --git a/linux/drivers/media/dvb/frontends/at76c651.h b/linux/drivers/media/dvb/frontends/at76c651.h index 47fd9af48..34054df93 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.h +++ b/linux/drivers/media/dvb/frontends/at76c651.h @@ -1,6 +1,6 @@ /* * at76c651.c - * + * * Atmel DVB-C Frontend Driver (at76c651) * * Copyright (C) 2001 fnbrd <fnbrd@gmx.de> @@ -41,7 +41,7 @@ struct at76c651_config int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); }; -extern struct dvb_frontend* at76c651_attach(const struct at76c651_config* config, +extern struct dvb_frontend* at76c651_attach(const struct at76c651_config* config, struct i2c_adapter* i2c); #endif // AT76C651_H diff --git a/linux/drivers/media/dvb/frontends/cx22700.c b/linux/drivers/media/dvb/frontends/cx22700.c index cddfe05a8..663002da3 100644 --- a/linux/drivers/media/dvb/frontends/cx22700.c +++ b/linux/drivers/media/dvb/frontends/cx22700.c @@ -230,16 +230,6 @@ static int cx22700_get_tps (struct cx22700_state* state, struct dvb_ofdm_paramet return 0; } - - - - - - - - - - static int cx22700_init (struct dvb_frontend* fe) { struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; @@ -409,11 +399,11 @@ error: static struct dvb_frontend_ops cx22700_ops = { .info = { - .name = "Conexant CX22700 DVB-T", - .type = FE_OFDM, - .frequency_min = 470000000, - .frequency_max = 860000000, - .frequency_stepsize = 166667, + .name = "Conexant CX22700 DVB-T", + .type = FE_OFDM, + .frequency_min = 470000000, + .frequency_max = 860000000, + .frequency_stepsize = 166667, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | diff --git a/linux/drivers/media/dvb/frontends/cx22702.c b/linux/drivers/media/dvb/frontends/cx22702.c index 845a5a4cd..7bcff1c62 100644 --- a/linux/drivers/media/dvb/frontends/cx22702.c +++ b/linux/drivers/media/dvb/frontends/cx22702.c @@ -195,18 +195,6 @@ static int cx22702_get_tps (struct cx22702_state *state, struct dvb_ofdm_paramet return 0; } - - - - - - - - - - - - /* Talk to the demod, set the FEC, GUARD, QAM settings etc */ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { @@ -259,7 +247,7 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet return 0; } - /* manually programmed values */ + /* manually programmed values */ val=0; switch(p->u.ofdm.constellation) { case QPSK: val = (val&0xe7); break; @@ -332,7 +320,6 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet return 0; } - /* Reset the demod hardware and reset all of the configuration registers to a default state. */ static int cx22702_init (struct dvb_frontend* fe) diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c index 5121a8939..4bbffaae2 100644 --- a/linux/drivers/media/dvb/frontends/cx24110.c +++ b/linux/drivers/media/dvb/frontends/cx24110.c @@ -131,7 +131,6 @@ static int cx24110_writereg (struct cx24110_state* state, int reg, int data) return 0; } - static int cx24110_readreg (struct cx24110_state* state, u8 reg) { int ret; @@ -181,7 +180,6 @@ static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inver return 0; } - static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) { /* fixme (low): error handling */ @@ -227,7 +225,6 @@ static int cx24110_set_fec (struct cx24110_state* state, fe_code_rate_t fec) return 0; } - static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state) { int i; @@ -244,7 +241,6 @@ static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state) } } - static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate) { /* fixme (low): add error handling */ @@ -317,17 +313,6 @@ dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); } - - - - - - - - - - - int cx24110_pll_write (struct dvb_frontend* fe, u32 data) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -369,8 +354,6 @@ int cx24110_pll_write (struct dvb_frontend* fe, u32 data) return 0; } - - static int cx24110_initfe(struct dvb_frontend* fe) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -388,7 +371,6 @@ static int cx24110_initfe(struct dvb_frontend* fe) return 0; } - static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; @@ -531,7 +513,7 @@ static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { - struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; + struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; s32 afc; unsigned sclk; /* cannot read back tuner settings (freq). Need to have some private storage */ @@ -558,7 +540,7 @@ static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { - struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; + struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; return cx24110_writereg(state,0x76,(cx24110_readreg(state,0x76)&~0x10)|(((tone==SEC_TONE_ON))?0x10:0)); } @@ -587,7 +569,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, memcpy(&state->ops, &cx24110_ops, sizeof(struct dvb_frontend_ops)); state->lastber = 0; state->lastbler = 0; - state->lastesn0 = 0; + state->lastesn0 = 0; /* check if the demod is there */ ret = cx24110_readreg(state, 0x00); diff --git a/linux/drivers/media/dvb/frontends/dib3000-common.c b/linux/drivers/media/dvb/frontends/dib3000-common.c index 13ba61d53..1a4f1f7c2 100644 --- a/linux/drivers/media/dvb/frontends/dib3000-common.c +++ b/linux/drivers/media/dvb/frontends/dib3000-common.c @@ -9,6 +9,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c,4=srch (|-able))."); #define deb_i2c(args...) dprintk(0x02,args) #define deb_srch(args...) dprintk(0x04,args) + int dib3000_read_reg(struct dib3000_state *state, u16 reg) { u8 wb[] = { ((reg >> 8) | 0x80) & 0xff, reg & 0xff }; @@ -17,10 +18,10 @@ int dib3000_read_reg(struct dib3000_state *state, u16 reg) { .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) deb_i2c("i2c read error\n"); - + deb_i2c("reading i2c bus (reg: %5d 0x%04x, val: %5d 0x%04x)\n",reg,reg, (rb[0] << 8) | rb[1],(rb[0] << 8) | rb[1]); @@ -33,8 +34,8 @@ int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val) (reg >> 8) & 0xff, reg & 0xff, (val >> 8) & 0xff, val & 0xff, }; - struct i2c_msg msg[] = { - { .addr = state->config.demod_address, .flags = 0, .buf = b, .len = 4 } + struct i2c_msg msg[] = { + { .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); @@ -55,7 +56,7 @@ int dib3000_search_status(u16 irq,u16 lock) deb_srch("auto search failed\n"); return 0; // auto search failed } - return -1; // try again + return -1; // try again } /* for auto search */ @@ -72,7 +73,7 @@ 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_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb frontend drivers"); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(dib3000_seq); diff --git a/linux/drivers/media/dvb/frontends/dib3000.h b/linux/drivers/media/dvb/frontends/dib3000.h index a5e21f6bb..80687c130 100644 --- a/linux/drivers/media/dvb/frontends/dib3000.h +++ b/linux/drivers/media/dvb/frontends/dib3000.h @@ -1,5 +1,5 @@ /* - * public header file of the frontend drivers for mobile DVB-T demodulators + * public header file of the frontend drivers for mobile DVB-T demodulators * DiBcom 3000M-B and DiBcom 3000P/M-C (http://www.dibcom.fr/) * * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) diff --git a/linux/drivers/media/dvb/frontends/dib3000mb.c b/linux/drivers/media/dvb/frontends/dib3000mb.c index 71bd57705..3beb4483a 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mb.c +++ b/linux/drivers/media/dvb/frontends/dib3000mb.c @@ -20,6 +20,7 @@ * see Documentation/dvb/README.dibusb for more information * */ + #include <linux/config.h> #include <linux/kernel.h> #include <linux/version.h> @@ -41,7 +42,7 @@ static int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-able))."); -#endif +#endif #define deb_info(args...) dprintk(0x01,args) #define deb_xfer(args...) dprintk(0x02,args) #define deb_setf(args...) dprintk(0x04,args) @@ -290,12 +291,12 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe, wr(DIB3000MB_REG_RESTART, DIB3000MB_RESTART_AUTO_SEARCH); wr(DIB3000MB_REG_RESTART, DIB3000MB_RESTART_OFF); - while ((search_state = + while ((search_state = dib3000_search_status( rd(DIB3000MB_REG_AS_IRQ_PENDING), - rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100) + rd(DIB3000MB_REG_LOCK2_VALUE))) < 0 && as_count++ < 100) msleep(1); - + deb_setf("search_state after autosearch %d after %d checks\n",search_state,as_count); if (search_state == 1) { @@ -430,7 +431,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, fep->inversion = ((inv_test2 == 2) && (inv_test1==1 || inv_test1==0)) || - ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? + ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? INVERSION_ON : INVERSION_OFF; deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion); @@ -451,7 +452,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, default: err("Unexpected constellation returned by TPS (%d)", tps_val); break; - } + } deb_getf("TPS: %d\n", tps_val); if (rd(DIB3000MB_REG_TPS_HRCH)) { @@ -480,7 +481,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, break; } deb_getf("TPS: %d\n", tps_val); - + tps_val = rd(DIB3000MB_REG_TPS_CODE_RATE_LP); } else { deb_getf("HRCH OFF\n"); @@ -668,7 +669,7 @@ static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int return 0; } -static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) +static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; @@ -681,7 +682,7 @@ static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) return 0; } -static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff) +static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = fe->demodulator_priv; deb_xfer("%s pid parsing\n",onoff ? "enabling" : "disabling"); @@ -718,12 +719,12 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, memcpy(&state->ops, &dib3000mb_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ - if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) + if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) goto error; if (rd(DIB3000_REG_DEVICE_ID) != DIB3000MB_DEVICE_ID) goto error; - + /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; @@ -733,7 +734,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, 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; error: @@ -741,14 +742,14 @@ error: kfree(state); return NULL; } - + static struct dvb_frontend_ops dib3000mb_ops = { .info = { .name = "DiBcom 3000M-B DVB-T", - .type = FE_OFDM, - .frequency_min = 44250000, - .frequency_max = 867250000, + .type = FE_OFDM, + .frequency_min = 44250000, + .frequency_max = 867250000, .frequency_stepsize = 62500, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | diff --git a/linux/drivers/media/dvb/frontends/dib3000mc.c b/linux/drivers/media/dvb/frontends/dib3000mc.c index 9bed3dd05..76707bfca 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc.c +++ b/linux/drivers/media/dvb/frontends/dib3000mc.c @@ -51,7 +51,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe,16=s static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr); static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, - fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) + fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) { switch (transmission_mode) { case TRANSMISSION_MODE_2K: @@ -60,13 +60,13 @@ static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, case TRANSMISSION_MODE_8K: wr_foreach(dib3000mc_reg_fft,dib3000mc_fft_modes[1]); break; - default: + default: break; } switch (bandwidth) { /* case BANDWIDTH_5_MHZ: - wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[0]); + wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[0]); break; */ case BANDWIDTH_6_MHZ: wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[1]); @@ -77,12 +77,12 @@ static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, case BANDWIDTH_8_MHZ: wr_foreach(dib3000mc_reg_impulse_noise,dib3000mc_impluse_noise[3]); break; - default: + default: break; } switch (mode) { - case 0: /* no impulse */ /* fall through */ + case 0: /* no impulse */ /* fall through */ wr_foreach(dib3000mc_reg_imp_noise_ctl,dib3000mc_imp_noise_ctl[0]); break; case 1: /* new algo */ @@ -107,14 +107,14 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, case BANDWIDTH_8_MHZ: comp = DIB3000MC_CLOCK_REF*8; break; case BANDWIDTH_7_MHZ: comp = DIB3000MC_CLOCK_REF*7; break; case BANDWIDTH_6_MHZ: comp = DIB3000MC_CLOCK_REF*6; break; - default: err("unknown bandwidth (%d)",bw); break; + default: err("unknown bandwidth (%d)",bw); break; } timf_msb = (comp >> 16) & 0xff; timf_lsb = (comp & 0xffff); // Update the timing offset ; if (upd_offset > 0) { - if (!state->timing_offset_comp_done) { + if (!state->timing_offset_comp_done) { msleep(200); state->timing_offset_comp_done = 1; } @@ -128,11 +128,11 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, tim_offset = state->timing_offset; if (tim_offset < 0) { - tim_sgn = 1; + tim_sgn = 1; tim_offset = -tim_offset; - } else + } else tim_sgn = 0; - + comp1 = (u32)tim_offset * (u32)timf_lsb ; comp2 = (u32)tim_offset * (u32)timf_msb ; comp = ((comp1 >> 16) + comp2) >> 7; @@ -141,7 +141,7 @@ static int dib3000mc_set_timing(struct dib3000_state *state, int upd_offset, comp = (u32)(timf_msb << 16) + (u32) timf_lsb + comp; else comp = (u32)(timf_msb << 16) + (u32) timf_lsb - comp ; - + timf_msb = (comp >> 16) & 0xff; timf_lsb = comp & 0xffff; @@ -177,7 +177,7 @@ static int dib3000mc_init_auto_scan(struct dib3000_state *state, fe_bandwidth_t return -EINVAL; } if (boost) { - u32 timeout = (rd(DIB3000MC_REG_BW_TIMOUT_MSB) << 16) + + u32 timeout = (rd(DIB3000MC_REG_BW_TIMOUT_MSB) << 16) + rd(DIB3000MC_REG_BW_TIMOUT_LSB); timeout *= 85; timeout >>= 7; wr(DIB3000MC_REG_BW_TIMOUT_MSB,(timeout >> 16) & 0xffff); @@ -189,13 +189,13 @@ static int dib3000mc_init_auto_scan(struct dib3000_state *state, fe_bandwidth_t static int dib3000mc_set_adp_cfg(struct dib3000_state *state, fe_modulation_t con) { switch (con) { - case QAM_64: + case QAM_64: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[2]); break; - case QAM_16: + case QAM_16: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[1]); break; - case QPSK: + case QPSK: wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[0]); break; case QAM_AUTO: @@ -237,7 +237,7 @@ static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_fro } switch (ofdm->hierarchy_information) { case HIERARCHY_NONE: /* fall through */ - case HIERARCHY_1: alpha = DIB3000_ALPHA_1; break; + case HIERARCHY_1: alpha = DIB3000_ALPHA_1; break; case HIERARCHY_2: alpha = DIB3000_ALPHA_2; break; case HIERARCHY_4: alpha = DIB3000_ALPHA_4; break; case HIERARCHY_AUTO: break; @@ -262,7 +262,7 @@ static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_fro case FEC_AUTO: break; default: return -EINVAL; } - + wr(DIB3000MC_REG_DEMOD_PARM,DIB3000MC_DEMOD_PARM(alpha,qam,guard,fft)); wr(DIB3000MC_REG_HRCH_PARM,DIB3000MC_HRCH_PARM(sel_hp,cr,hrch)); @@ -327,14 +327,14 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe, fep->inversion = ((inv_test2 == 2) && (inv_test1==1 || inv_test1==0)) || - ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? + ((inv_test2 == 0) && (inv_test1==1 || inv_test1==2)) ? INVERSION_ON : INVERSION_OFF; deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion); fep->frequency = state->last_tuned_freq; fep->u.ofdm.bandwidth= state->last_tuned_bw; - + tps_val = rd(DIB3000MC_REG_TUNING_PARM); switch (DIB3000MC_TP_QAM(tps_val)) { @@ -353,7 +353,7 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe, default: err("Unexpected constellation returned by TPS (%d)", tps_val); break; - } + } if (DIB3000MC_TP_HRCH(tps_val)) { deb_getf("HRCH ON "); @@ -462,12 +462,12 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; int search_state,auto_val; u16 val; - + if (tuner) { /* initial call from dvb */ dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); state->config.pll_set(fe,fep,NULL); dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); - + state->last_tuned_freq = fep->frequency; // if (!scanboost) { dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth); @@ -477,7 +477,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_AGC); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); - + /* Default cfg isi offset adp */ wr_foreach(dib3000mc_reg_offset,dib3000mc_offset[0]); @@ -495,7 +495,7 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, auto_val = 0; dib3000mc_set_general_cfg(state,fep,&auto_val); dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val|DIB3000MC_DEMOD_RST_DEMOD_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); @@ -507,17 +507,17 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, int as_count=0; deb_setf("autosearch enabled.\n"); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); while ((search_state = dib3000_search_status( - rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) + rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) msleep(10); - + deb_info("search_state after autosearch %d after %d checks\n",search_state,as_count); - + if (search_state == 1) { struct dvb_frontend_parameters feps; if (dib3000mc_get_frontend(fe, &feps) == 0) { @@ -529,33 +529,31 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe, dib3000mc_set_impulse_noise(state,0,ofdm->transmission_mode,ofdm->bandwidth); wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); dib3000mc_set_adp_cfg(state,ofdm->constellation); - + /* set_offset_cfg */ wr_foreach(dib3000mc_reg_offset, dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); } } else { /* second call, after autosearch (fka: set_WithKnownParams) */ // dib3000mc_set_timing(state,1,ofdm->transmission_mode,ofdm->bandwidth); - + auto_val = 0; dib3000mc_set_general_cfg(state,fep,&auto_val); if (auto_val) deb_info("auto_val is true, even though an auto search was already performed.\n"); dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); - + val = rd(DIB3000MC_REG_DEMOD_PARM); wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); wr(DIB3000MC_REG_DEMOD_PARM,val); - + msleep(30); - + wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); dib3000mc_set_adp_cfg(state,ofdm->constellation); wr_foreach(dib3000mc_reg_offset, dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); - - } return 0; } @@ -567,26 +565,26 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) state->timing_offset = 0; state->timing_offset_comp_done = 0; - + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_CONFIG); wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_UP); wr(DIB3000MC_REG_CLK_CFG_2,DIB3000MC_CLK_CFG_2_PUP_MOBILE); wr(DIB3000MC_REG_CLK_CFG_3,DIB3000MC_CLK_CFG_3_POWER_UP); wr(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_INIT); - + wr(DIB3000MC_REG_RST_UNC,DIB3000MC_RST_UNC_OFF); wr(DIB3000MC_REG_UNK_19,DIB3000MC_UNK_19); wr(33,5); wr(36,81); - wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); - + wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); + wr(DIB3000MC_REG_UNK_99,DIB3000MC_UNK_99); wr(DIB3000MC_REG_UNK_111,DIB3000MC_UNK_111_PH_N_MODE_0); /* phase noise algo off */ /* mobile mode - portable reception */ - wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); + wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); /* TUNER_PANASONIC_ENV57H12D5: */ wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); @@ -599,24 +597,24 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) wr(DIB3000MC_REG_UNK_2,DIB3000MC_UNK_2); wr(DIB3000MC_REG_UNK_3,DIB3000MC_UNK_3); wr(DIB3000MC_REG_SEQ_TPS,DIB3000MC_SEQ_TPS_DEFAULT); - + wr_foreach(dib3000mc_reg_bandwidth,dib3000mc_bandwidth_8mhz); wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); - + wr(DIB3000MC_REG_UNK_4,DIB3000MC_UNK_4); wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_OFF); wr(DIB3000MC_REG_SET_DDS_FREQ_LSB,DIB3000MC_DDS_FREQ_LSB); - dib3000mc_set_timing(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); + dib3000mc_set_timing(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); // wr_foreach(dib3000mc_reg_timing_freq,dib3000mc_timing_freq[3]); - + wr(DIB3000MC_REG_UNK_120,DIB3000MC_UNK_120); wr(DIB3000MC_REG_UNK_134,DIB3000MC_UNK_134); wr(DIB3000MC_REG_FEC_CFG,DIB3000MC_FEC_CFG); - + wr(DIB3000MC_REG_DIVERSITY3,DIB3000MC_DIVERSITY3_IN_OFF); - + dib3000mc_set_impulse_noise(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); /* output mode control, just the MPEG2_SLAVE */ @@ -632,13 +630,13 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) rd(DIB3000MC_REG_OUTMODE))); wr(DIB3000MC_REG_SMO_MODE, - DIB3000MC_SMO_MODE_DEFAULT | + DIB3000MC_SMO_MODE_DEFAULT | DIB3000MC_SMO_MODE_188); wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_DEFAULT); wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); */ - + /* diversity */ wr(DIB3000MC_REG_DIVERSITY1,DIB3000MC_DIVERSITY1_DEFAULT); wr(DIB3000MC_REG_DIVERSITY2,DIB3000MC_DIVERSITY2_DEFAULT); @@ -708,14 +706,14 @@ static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB), val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB); u16 sig,noise; - + sig = (((val >> 6) & 0xff) << 8) + (val & 0x3f); noise = (((val >> 4) & 0xff) << 8) + ((val & 0xf) << 2) + ((val2 >> 14) & 0x3); if (noise == 0) *snr = 0xffff; else *snr = (u16) sig/noise; - + deb_stat("signal: mantisse = %d, exponent = %d\n",(sig >> 8) & 0xff, sig & 0xff); deb_stat("noise: mantisse = %d, exponent = %d\n",(noise >> 8) & 0xff, noise & 0xff); deb_stat("snr: %d\n",*snr); @@ -753,7 +751,7 @@ static int dib3000mc_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_ } static void dib3000mc_release(struct dvb_frontend* fe) -{ +{ struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; kfree(state); } @@ -771,9 +769,9 @@ static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - + deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); - + if (onoff) { deb_xfer("%d %x\n",tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); wr(DIB3000MC_REG_SMO_MODE,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); @@ -784,13 +782,13 @@ static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) return 0; } -static int dib3000mc_pid_parse(struct dvb_frontend *fe, int onoff) +static int dib3000mc_pid_parse(struct dvb_frontend *fe, int onoff) { struct dib3000_state *state = fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - + deb_xfer("%s pid parsing\n",onoff ? "enabling" : "disabling"); - + if (onoff) { wr(DIB3000MC_REG_SMO_MODE,tmp | DIB3000MC_SMO_MODE_PID_PARSE); } else { @@ -810,7 +808,7 @@ static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_ return 0; } -static int dib3000mc_demod_init(struct dib3000_state *state) +static int dib3000mc_demod_init(struct dib3000_state *state) { u16 default_addr = 0x0a; /* first init */ @@ -818,13 +816,13 @@ static int dib3000mc_demod_init(struct dib3000_state *state) deb_info("initializing the demod the first time. Setting demod addr to 0x%x\n",default_addr); 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(default_addr) | DIB3000MC_DEMOD_ADDR_ON); - + state->config.demod_address = default_addr; - + wr(DIB3000MC_REG_RST_I2C_ADDR, DIB3000MC_DEMOD_ADDR(default_addr)); } else @@ -852,13 +850,13 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, memcpy(&state->ops, &dib3000mc_ops, sizeof(struct dvb_frontend_ops)); /* check for the correct demod */ - if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) + if (rd(DIB3000_REG_MANUFACTOR_ID) != DIB3000_I2C_ID_DIBCOM) goto error; devid = rd(DIB3000_REG_DEVICE_ID); if (devid != DIB3000MC_DEVICE_ID && devid != DIB3000P_DEVICE_ID) goto error; - + switch (devid) { case DIB3000MC_DEVICE_ID: info("Found a DiBcom 3000M-C, interesting..."); @@ -879,7 +877,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, xfer_ops->tuner_pass_ctrl = dib3000mc_tuner_pass_ctrl; dib3000mc_demod_init(state); - + return &state->frontend; error: @@ -887,20 +885,20 @@ error: kfree(state); return NULL; } - + static struct dvb_frontend_ops dib3000mc_ops = { .info = { .name = "DiBcom 3000P/M-C DVB-T", - .type = FE_OFDM, - .frequency_min = 44250000, - .frequency_max = 867250000, + .type = FE_OFDM, + .frequency_min = 44250000, + .frequency_max = 867250000, .frequency_stepsize = 62500, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | - FE_CAN_TRANSMISSION_MODE_AUTO | + FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_RECOVER | FE_CAN_HIERARCHY_AUTO, diff --git a/linux/drivers/media/dvb/frontends/dib3000mc_priv.h b/linux/drivers/media/dvb/frontends/dib3000mc_priv.h index 178403da1..2930aac75 100644 --- a/linux/drivers/media/dvb/frontends/dib3000mc_priv.h +++ b/linux/drivers/media/dvb/frontends/dib3000mc_priv.h @@ -1,12 +1,12 @@ /* * dib3000mc_priv.h - * + * * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. - * + * * for more information see dib3000mc.c . */ @@ -15,10 +15,10 @@ /* * Demodulator parameters - * reg: 0 1 1 1 11 11 111 + * reg: 0 1 1 1 11 11 111 * | | | | | | * | | | | | +-- alpha (000=0, 001=1, 010=2, 100=4) - * | | | | +----- constellation (00=QPSK, 01=16QAM, 10=64QAM) + * | | | | +----- constellation (00=QPSK, 01=16QAM, 10=64QAM) * | | | +-------- guard (00=1/32, 01=1/16, 10=1/8, 11=1/4) * | | +----------- transmission mode (0=2k, 1=8k) * | | @@ -49,7 +49,7 @@ (0x1 & s) | \ ((0x7 & f) << 1) | \ ((0x1 & h) << 4) ) - + /* timeout ??? */ #define DIB3000MC_REG_UNK_1 ( 1) #define DIB3000MC_UNK_1 ( 0x04) @@ -74,16 +74,16 @@ #define DIB3000MC_IS_TPS(v) ((v << 8) & 0x1) #define DIB3000MC_IS_AS(v) ((v >> 4) & 0xf) -/* parameters for the bandwidth */ +/* parameters for the bandwidth */ #define DIB3000MC_REG_BW_TIMOUT_MSB ( 6) #define DIB3000MC_REG_BW_TIMOUT_LSB ( 7) static u16 dib3000mc_reg_bandwidth[] = { 6,7,8,9,10,11,16,17 }; -/*static u16 dib3000mc_bandwidth_5mhz[] = +/*static u16 dib3000mc_bandwidth_5mhz[] = { 0x28, 0x9380, 0x87, 0x4100, 0x2a4, 0x4500, 0x1, 0xb0d0 };*/ -static u16 dib3000mc_bandwidth_6mhz[] = +static u16 dib3000mc_bandwidth_6mhz[] = { 0x21, 0xd040, 0x70, 0xb62b, 0x233, 0x8ed5, 0x1, 0xb0d0 }; static u16 dib3000mc_bandwidth_7mhz[] = @@ -107,7 +107,7 @@ static u16 dib3000mc_bandwidth_general[] = { 0x0000, 0x03e8, 0x0000, 0x03f2 }; #define DIB3000MC_REG_UNK_19 ( 19) #define DIB3000MC_UNK_19 ( 0) -/* DDS frequency value (IF position) and inversion bit */ +/* DDS frequency value (IF position) and inversion bit */ #define DIB3000MC_REG_INVERSION ( 21) #define DIB3000MC_REG_SET_DDS_FREQ_MSB ( 21) #define DIB3000MC_DDS_FREQ_MSB_INV_OFF (0x0164) @@ -125,7 +125,7 @@ static u16 dib3000mc_bandwidth_general[] = { 0x0000, 0x03e8, 0x0000, 0x03f2 }; //static u16 dib3000mc_timing_freq[][2] = { // { 0x69, 0x9f18 }, /* 5 MHz */ -// { 0x7e ,0xbee9 }, /* 6 MHz */ +// { 0x7e ,0xbee9 }, /* 6 MHz */ // { 0x93 ,0xdebb }, /* 7 MHz */ // { 0xa8 ,0xfe8c }, /* 8 MHz */ //}; @@ -155,7 +155,7 @@ static u16 dib3000mc_imp_noise_ctl[][2] = { { 0x1294, 0x1ff8 }, /* mode 4 */ }; -/* AGC registers */ +/* AGC registers */ static u16 dib3000mc_reg_agc[] = { 36,37,38,39,42,43,44,45,46,47,48,49 }; @@ -164,8 +164,8 @@ static u16 dib3000mc_agc_tuner[][12] = { { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xcf5c, 0x6666, 0xbae1, 0xa148, 0x3b5e, 0x3c1c, 0x001a, 0x2019 }, /* TUNER_PANASONIC_ENV77H04D5, */ - - { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a, + + { 0x0051, 0x301d, 0x0000, 0x1cc7, 0xdc29, 0x570a, 0xbae1, 0x8ccd, 0x3b6d, 0x551d, 0x000a, 0x951e }, /* TUNER_PANASONIC_ENV57H13D5, TUNER_PANASONIC_ENV57H12D5 */ @@ -184,10 +184,10 @@ static u16 dib3000mc_reg_agc_bandwidth[] = { 40,41 }; static u16 dib3000mc_agc_bandwidth[] = { 0x119,0x330 }; static u16 dib3000mc_reg_agc_bandwidth_general[] = { 50,51,52,53,54 }; -static u16 dib3000mc_agc_bandwidth_general[] = +static u16 dib3000mc_agc_bandwidth_general[] = { 0x8000, 0x91ca, 0x01ba, 0x0087, 0x0087 }; -#define DIB3000MC_REG_IMP_NOISE_55 ( 55) +#define DIB3000MC_REG_IMP_NOISE_55 ( 55) #define DIB3000MC_IMP_NEW_ALGO(w) (w | (1<<10)) /* Impulse noise params */ @@ -202,26 +202,26 @@ static u16 dib3000mc_impluse_noise[][3] = { static u16 dib3000mc_reg_fft[] = { 58,59,60,61,62,63,64,65,66,67,68,69, 70,71,72,73,74,75,76,77,78,79,80,81, - 82,83,84,85,86 + 82,83,84,85,86 }; static u16 dib3000mc_fft_modes[][29] = { - { 0x38, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, - 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, - 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, - 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, - 0x3ffe, 0x5b3, 0x3feb, 0x76, 0x0, 0xd + { 0x38, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, + 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, + 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, + 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, + 0x3ffe, 0x5b3, 0x3feb, 0x76, 0x0, 0xd }, /* fft mode 0 */ { 0x3b, 0x6d9, 0x3f28, 0x7a7, 0x3a74, 0x196, 0x32a, 0x48c, - 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, - 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, - 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, - 0x3ffe, 0x5b3, 0x3feb, 0x0, 0x8200, 0xd + 0x3ffe, 0x7f3, 0x2d94, 0x76, 0x53d, + 0x3ff8, 0x7e3, 0x3320, 0x76, 0x5b3, + 0x3feb, 0x7d2, 0x365e, 0x76, 0x48c, + 0x3ffe, 0x5b3, 0x3feb, 0x0, 0x8200, 0xd }, /* fft mode 1 */ }; #define DIB3000MC_REG_UNK_88 ( 88) -#define DIB3000MC_UNK_88 (0x0410) +#define DIB3000MC_UNK_88 (0x0410) static u16 dib3000mc_reg_bw[] = { 93,94,95,96,97,98 }; static u16 dib3000mc_bw[][6] = { @@ -261,7 +261,7 @@ static u16 dib3000mc_bw[][6] = { /* adapter config for constellation */ static u16 dib3000mc_reg_adp_cfg[] = { 129, 130, 131, 132 }; -static u16 dib3000mc_adp_cfg[][4] = { +static u16 dib3000mc_adp_cfg[][4] = { { 0x99a, 0x7fae, 0x333, 0x7ff0 }, /* QPSK */ { 0x23d, 0x7fdf, 0x0a4, 0x7ff0 }, /* 16-QAM */ { 0x148, 0x7ff0, 0x0a4, 0x7ff8 }, /* 64-QAM */ @@ -299,7 +299,7 @@ static u16 dib3000mc_mobile_mode[][5] = { * |||| +---- fifo_ctrl (1 = inhibit (flushed), 0 = active (unflushed)) * |||+------ pid_parse (1 = enabled, 0 = disabled) * ||+------- outp_188 (1 = TS packet size 188, 0 = packet size 204) - * |+-------- unk + * |+-------- unk * +--------- unk */ diff --git a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c index 8e94d99f3..375d6f3b4 100644 --- a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c +++ b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c @@ -27,14 +27,12 @@ #include "dvb_dummy_fe.h" - struct dvb_dummy_fe_state { - struct dvb_frontend_ops ops; - struct dvb_frontend frontend; }; + static int dvb_dummy_fe_read_status(struct dvb_frontend* fe, fe_status_t* status) { *status = FE_HAS_SIGNAL @@ -179,9 +177,9 @@ static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = { .info = { .name = "Dummy DVB-T", - .type = FE_OFDM, - .frequency_min = 0, - .frequency_max = 863250000, + .type = FE_OFDM, + .frequency_min = 0, + .frequency_max = 863250000, .frequency_stepsize = 62500, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | @@ -211,12 +209,12 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = { .info = { .name = "Dummy DVB-C", - .type = FE_QAM, + .type = FE_QAM, .frequency_stepsize = 62500, - .frequency_min = 51000000, - .frequency_max = 858000000, - .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */ - .symbol_rate_max = (57840000/2)/4, /* SACLK/4 */ + .frequency_min = 51000000, + .frequency_max = 858000000, + .symbol_rate_min = (57840000/2)/64, /* SACLK/64 == (XIN/2)/64 */ + .symbol_rate_max = (57840000/2)/4, /* SACLK/4 */ .caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO @@ -240,14 +238,14 @@ static struct dvb_frontend_ops dvb_dummy_fe_qam_ops = { static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = { .info = { - .name = "Dummy DVB-S", - .type = FE_QPSK, - .frequency_min = 950000, - .frequency_max = 2150000, - .frequency_stepsize = 250, /* kHz for QPSK frontends */ - .frequency_tolerance = 29500, - .symbol_rate_min = 1000000, - .symbol_rate_max = 45000000, + .name = "Dummy DVB-S", + .type = FE_QPSK, + .frequency_min = 950000, + .frequency_max = 2150000, + .frequency_stepsize = 250, /* kHz for QPSK frontends */ + .frequency_tolerance = 29500, + .symbol_rate_min = 1000000, + .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | @@ -269,7 +267,7 @@ static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops = { .read_ucblocks = dvb_dummy_fe_read_ucblocks, .set_voltage = dvb_dummy_fe_set_voltage, - .set_tone = dvb_dummy_fe_set_tone, + .set_tone = dvb_dummy_fe_set_tone, }; MODULE_DESCRIPTION("DVB DUMMY Frontend"); diff --git a/linux/drivers/media/dvb/frontends/l64781.c b/linux/drivers/media/dvb/frontends/l64781.c index 9d2a98194..66e7426d0 100644 --- a/linux/drivers/media/dvb/frontends/l64781.c +++ b/linux/drivers/media/dvb/frontends/l64781.c @@ -31,17 +31,13 @@ struct l64781_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct l64781_config* config; - struct dvb_frontend frontend; /* private demodulator data */ - int first:1; + int first:1; }; #define dprintk(args...) \ @@ -543,7 +539,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds to all reads with 0 */ if (l64781_readreg(state, 0x1a) != 0) { - dprintk("Read 1 returned unexpcted value\n"); + dprintk("Read 1 returned unexpcted value\n"); goto error; } @@ -552,7 +548,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, /* Responds with register default value */ if (l64781_readreg(state, 0x1a) != 0xa1) { - dprintk("Read 2 returned unexpcted value\n"); + dprintk("Read 2 returned unexpcted value\n"); goto error; } @@ -580,10 +576,10 @@ static struct dvb_frontend_ops l64781_ops = { .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | - FE_CAN_MUTE_TS + FE_CAN_MUTE_TS }, - .release = l64781_release, + .release = l64781_release, .init = l64781_init, .sleep = l64781_sleep, diff --git a/linux/drivers/media/dvb/frontends/mt312.c b/linux/drivers/media/dvb/frontends/mt312.c index 4f4fef72a..9880b3742 100644 --- a/linux/drivers/media/dvb/frontends/mt312.c +++ b/linux/drivers/media/dvb/frontends/mt312.c @@ -36,14 +36,10 @@ struct mt312_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct mt312_config* config; - struct dvb_frontend frontend; u8 id; @@ -228,20 +224,6 @@ static int mt312_get_code_rate(struct mt312_state* state, fe_code_rate_t *cr) return 0; } - - - - - - - - - - - - - - static int mt312_initfe(struct dvb_frontend* fe) { struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; @@ -716,7 +698,7 @@ static struct dvb_frontend_ops vp310_mt312_ops = { FE_CAN_RECOVER }, - .release = mt312_release, + .release = mt312_release, .init = mt312_initfe, .sleep = mt312_sleep, diff --git a/linux/drivers/media/dvb/frontends/mt312_priv.h b/linux/drivers/media/dvb/frontends/mt312_priv.h index 1ddff687e..5e0b95b53 100644 --- a/linux/drivers/media/dvb/frontends/mt312_priv.h +++ b/linux/drivers/media/dvb/frontends/mt312_priv.h @@ -1,4 +1,4 @@ -/* +/* Driver for Zarlink MT312 QPSK Frontend Copyright (C) 2003 Andreas Oberritter <obi@linuxtv.org> diff --git a/linux/drivers/media/dvb/frontends/mt352.c b/linux/drivers/media/dvb/frontends/mt352.c index 3c82909ea..7e29a25c1 100644 --- a/linux/drivers/media/dvb/frontends/mt352.c +++ b/linux/drivers/media/dvb/frontends/mt352.c @@ -68,16 +68,16 @@ static int mt352_single_write(struct dvb_frontend *fe, u8 reg, u8 val) printk("mt352_write() to reg %x failed (err = %d)!\n", reg, err); return err; } - return 0; + return 0; } int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen) { int err,i; for (i=0; i < ilen-1; i++) - if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) + if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) return err; - + return 0; } @@ -108,7 +108,7 @@ int mt352_read(struct dvb_frontend *fe, u8 reg) { return mt352_read_register(fe->demodulator_priv,reg); } - + static int mt352_sleep(struct dvb_frontend* fe) { static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 }; diff --git a/linux/drivers/media/dvb/frontends/nxt2002.c b/linux/drivers/media/dvb/frontends/nxt2002.c index 55a4a5961..ff3b261fd 100644 --- a/linux/drivers/media/dvb/frontends/nxt2002.c +++ b/linux/drivers/media/dvb/frontends/nxt2002.c @@ -1,5 +1,5 @@ /* - Support for B2C2/BBTI Technisat Air2PC - ATSC + Support for B2C2/BBTI Technisat Air2PC - ATSC Copyright (C) 2004 Taylor Jacob <rtjacob@earthlink.net> @@ -59,7 +59,7 @@ static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len) u8 buf2 [256],x; int err; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 }; - + buf2[0] = reg; for (x = 0 ; x < len ; x++) buf2[x+1] = buf[x]; @@ -91,12 +91,12 @@ static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len) return 0; } -static u16 nxt2002_crc(u16 crc, u8 c) +static u16 nxt2002_crc(u16 crc, u8 c) { u8 i; u16 input = (u16) c & 0xFF; - + input<<=8; for(i=0 ;i<8 ;i++) { if((crc ^ input) & 0x8000) @@ -130,7 +130,7 @@ static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* if ((buf & 0x02) == 0) return 0; - + dprintk("Error writing multireg register %02X\n",reg); return 0; @@ -162,16 +162,16 @@ static void nxt2002_microcontroller_stop (struct nxt2002_state* state) buf[0] = 0x80; i2c_writebytes(state,0x22,buf,1); - while (counter < 20) { + while (counter < 20) { i2c_readbytes(state,0x31,buf,1); - if (buf[0] & 0x40) + if (buf[0] & 0x40) return; msleep(10); counter++; } dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n"); - return; + return; } static void nxt2002_microcontroller_start (struct nxt2002_state* state) @@ -211,7 +211,7 @@ static int nxt2002_writetuner (struct nxt2002_state* state, u8* data) /* write UC Opmode to begin transfer */ buf = 0x80; i2c_writebytes(state,0x21,&buf,1); - + while (count < 20) { i2c_readbytes(state,0x21,&buf,1); if ((buf & 0x80)== 0x00) @@ -243,7 +243,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 buf[256],written = 0,chunkpos = 0; - u16 rambase,position,crc = 0; + u16 rambase,position,crc = 0; dprintk("%s\n", __FUNCTION__); dprintk("Firmware is %d bytes\n",fw->size); @@ -251,7 +251,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware /* Get the RAM base for this nxt2002 */ i2c_readbytes(state,0x10,buf,1); - if (buf[0] & 0x10) rambase = 0x1000; else @@ -263,7 +262,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware buf[0] = 0x80; i2c_writebytes(state,0x2B,buf,1); - for (position = 0; position < fw->size ; position++) { if (written == 0) { crc = 0; @@ -274,7 +272,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware /* write starting address */ i2c_writebytes(state,0x29,buf,3); } - written++; + written++; chunkpos++; if ((written % 4) == 0) @@ -282,7 +280,6 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware crc = nxt2002_crc(crc,fw->data[position]); - if ((written == 255) || (position+1 == fw->size)) { /* write remaining bytes of firmware */ i2c_writebytes(state, chunkpos+4-(written %4), @@ -290,7 +287,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware written %4); buf[0] = crc << 8; buf[1] = crc & 0xFF; - + /* write crc */ i2c_writebytes(state,0x2C,buf,2); @@ -309,24 +306,23 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware return 0; }; - static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u32 freq = 0; - u16 tunerfreq = 0; + u16 tunerfreq = 0; u8 buf[4]; - freq = 44000 + ( p->frequency / 1000 ); + freq = 44000 + ( p->frequency / 1000 ); dprintk("freq = %d p->frequency = %d\n",freq,p->frequency); tunerfreq = freq * 24/4000; - + buf[0] = (tunerfreq >> 8) & 0x7F; buf[1] = (tunerfreq & 0xFF); - + if (p->frequency <= 214000000) { buf[2] = 0x84 + (0x06 << 3); buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02; @@ -337,7 +333,7 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, buf[2] = 0x84 + (0x0E << 3); buf[3] = 0x08; } else { - buf[2] = 0x84 + (0x0F << 3); + buf[2] = 0x84 + (0x0F << 3); buf[3] = 0x02; } @@ -347,8 +343,6 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, /* reset the agc now that tuning has been completed */ nxt2002_agc_reset(state); - - /* set target power level */ switch (p->u.vsb.modulation) { case QAM_64: @@ -449,7 +443,7 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, nxt2002_microcontroller_start(state); - /* adjacent channel detection should be done here, but I don't + /* adjacent channel detection should be done here, but I don't have any stations with this need so I cannot test it */ return 0; @@ -466,7 +460,7 @@ static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) *status |= FE_HAS_SIGNAL; *status |= FE_HAS_CARRIER; *status |= FE_HAS_VITERBI; - *status |= FE_HAS_SYNC; + *status |= FE_HAS_SYNC; *status |= FE_HAS_LOCK; } return 0; @@ -477,10 +471,10 @@ static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 b[3]; - nxt2002_readreg_multibyte(state,0xE6,b,3); + nxt2002_readreg_multibyte(state,0xE6,b,3); *ber = ((b[0] << 8) + b[1]) * 8; - + return 0; } @@ -495,7 +489,7 @@ static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) i2c_writebytes(state,0xA1,b,1); /* get multreg val */ - nxt2002_readreg_multibyte(state,0xA6,b,2); + nxt2002_readreg_multibyte(state,0xA6,b,2); temp = (b[0] << 8) | b[1]; *strength = ((0x7FFF - temp) & 0x0FFF) * 16; @@ -516,7 +510,7 @@ static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) i2c_writebytes(state,0xA1,b,1); /* get multreg val from 0xA6 */ - nxt2002_readreg_multibyte(state,0xA6,b,2); + nxt2002_readreg_multibyte(state,0xA6,b,2); temp = (b[0] << 8) | b[1]; temp2 = 0x7FFF - temp; @@ -542,9 +536,8 @@ static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) { struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; u8 b[3]; - - nxt2002_readreg_multibyte(state,0xE6,b,3); + nxt2002_readreg_multibyte(state,0xE6,b,3); *ucblocks = b[2]; return 0; @@ -582,7 +575,7 @@ static int nxt2002_init(struct dvb_frontend* fe) /* Put the micro into reset */ nxt2002_microcontroller_stop(state); - + /* ensure transfer is complete */ buf[0]=0; i2c_writebytes(state,0x2B,buf,1); @@ -597,7 +590,7 @@ static int nxt2002_init(struct dvb_frontend* fe) i2c_writebytes(state,0x08,buf,1); /* write agc sdm configure */ - buf[0] = 0xF1; + buf[0] = 0xF1; i2c_writebytes(state,0x57,buf,1); /* write mod output format */ @@ -654,11 +647,11 @@ struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, /* Check the first 5 registers to ensure this a revision we can handle */ i2c_readbytes(state, 0x00, buf, 5); - if (buf[0] != 0x04) goto error; /* device id */ - if (buf[1] != 0x02) goto error; /* fab id */ - if (buf[2] != 0x11) goto error; /* month */ - if (buf[3] != 0x20) goto error; /* year msb */ - if (buf[4] != 0x00) goto error; /* year lsb */ + if (buf[0] != 0x04) goto error; /* device id */ + if (buf[1] != 0x02) goto error; /* fab id */ + if (buf[2] != 0x11) goto error; /* month */ + if (buf[3] != 0x20) goto error; /* year msb */ + if (buf[4] != 0x00) goto error; /* year lsb */ /* create dvb_frontend */ state->frontend.ops = &state->ops; @@ -678,7 +671,7 @@ static struct dvb_frontend_ops nxt2002_ops = { .frequency_min = 54000000, .frequency_max = 860000000, /* stepsize is just a guess */ - .frequency_stepsize = 166666, + .frequency_stepsize = 166666, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_8VSB | FE_CAN_QAM_64 | FE_CAN_QAM_256 diff --git a/linux/drivers/media/dvb/frontends/nxt2002.h b/linux/drivers/media/dvb/frontends/nxt2002.h index a177d5e6b..462301f57 100644 --- a/linux/drivers/media/dvb/frontends/nxt2002.h +++ b/linux/drivers/media/dvb/frontends/nxt2002.h @@ -18,6 +18,6 @@ struct nxt2002_config }; extern struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, - struct i2c_adapter* i2c); + struct i2c_adapter* i2c); #endif // NXT2002_H diff --git a/linux/drivers/media/dvb/frontends/nxt6000.c b/linux/drivers/media/dvb/frontends/nxt6000.c index c0fa123e9..9708d4732 100644 --- a/linux/drivers/media/dvb/frontends/nxt6000.c +++ b/linux/drivers/media/dvb/frontends/nxt6000.c @@ -32,16 +32,11 @@ struct nxt6000_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct nxt6000_config* config; - struct dvb_frontend frontend; - }; static int debug = 0; @@ -424,16 +419,6 @@ static void nxt6000_dump_status(struct nxt6000_state *state) printk("\n"); } - - - - - - - - - - static int nxt6000_read_status(struct dvb_frontend* fe, fe_status_t* status) { u8 core_status; @@ -474,7 +459,6 @@ static int nxt6000_init(struct dvb_frontend* fe) return 0; } - static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) { struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; @@ -496,7 +480,6 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par return 0; } - static void nxt6000_release(struct dvb_frontend* fe) { struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/sp8870.c b/linux/drivers/media/dvb/frontends/sp8870.c index 72338d461..538cb03ee 100644 --- a/linux/drivers/media/dvb/frontends/sp8870.c +++ b/linux/drivers/media/dvb/frontends/sp8870.c @@ -130,7 +130,7 @@ static int sp8870_firmware_upload (struct sp8870_state* state, const struct firm msg.flags = 0; msg.buf = tx_buf; msg.len = tx_len + 2; - if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { + if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { printk("%s: firmware upload failed!\n", __FUNCTION__); printk ("%s: i2c error (err == %i)\n", __FUNCTION__, err); return err; diff --git a/linux/drivers/media/dvb/frontends/sp887x.c b/linux/drivers/media/dvb/frontends/sp887x.c index 5f7aee97a..f34c010d0 100644 --- a/linux/drivers/media/dvb/frontends/sp887x.c +++ b/linux/drivers/media/dvb/frontends/sp887x.c @@ -20,13 +20,9 @@ struct sp887x_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct sp887x_config* config; - struct dvb_frontend frontend; /* demodulator private data */ @@ -345,19 +341,6 @@ static void sp887x_correct_offsets (struct sp887x_state* state, sp887x_writereg(state, 0x30a, frequency_shift & 0xfff); } - - - - - - - - - - - - - static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { diff --git a/linux/drivers/media/dvb/frontends/stv0297.c b/linux/drivers/media/dvb/frontends/stv0297.c index e1e0b5e19..65255113f 100644 --- a/linux/drivers/media/dvb/frontends/stv0297.c +++ b/linux/drivers/media/dvb/frontends/stv0297.c @@ -29,13 +29,9 @@ #include "stv0297.h" struct stv0297_state { - struct i2c_adapter *i2c; - struct dvb_frontend_ops ops; - const struct stv0297_config *config; - struct dvb_frontend frontend; unsigned long base_freq; @@ -367,18 +363,6 @@ static int stv0297_set_inversion(struct stv0297_state *state, fe_spectral_invers return 0; } - - - - - - - - - - - - int stv0297_enable_plli2c(struct dvb_frontend *fe) { struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index bbe24fc47..a468f8804 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -54,13 +54,9 @@ #include "stv0299.h" struct stv0299_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct stv0299_config* config; - struct dvb_frontend frontend; u8 initialised:1; @@ -102,7 +98,6 @@ int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) return stv0299_writeregI(state, reg, data); } - static u8 stv0299_readreg (struct stv0299_state* state, u8 reg) { int ret; @@ -120,7 +115,6 @@ static u8 stv0299_readreg (struct stv0299_state* state, u8 reg) return b1[0]; } - static int stv0299_readregs (struct stv0299_state* state, u8 reg1, u8 *b, u8 len) { int ret; @@ -135,7 +129,6 @@ static int stv0299_readregs (struct stv0299_state* state, u8 reg1, u8 *b, u8 len return ret == 2 ? 0 : ret; } - static int stv0299_set_FEC (struct stv0299_state* state, fe_code_rate_t fec) { dprintk ("%s\n", __FUNCTION__); @@ -172,7 +165,6 @@ static int stv0299_set_FEC (struct stv0299_state* state, fe_code_rate_t fec) } } - static fe_code_rate_t stv0299_get_fec (struct stv0299_state* state) { static fe_code_rate_t fec_tab [] = { FEC_2_3, FEC_3_4, FEC_5_6, @@ -190,7 +182,6 @@ static fe_code_rate_t stv0299_get_fec (struct stv0299_state* state) return fec_tab [index]; } - static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout) { unsigned long start = jiffies; @@ -208,7 +199,6 @@ static int stv0299_wait_diseqc_fifo (struct stv0299_state* state, int timeout) return 0; } - static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) { unsigned long start = jiffies; @@ -244,7 +234,6 @@ static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) return state->config->set_symbol_rate(fe, srate, ratio); } - static int stv0299_get_symbolrate (struct stv0299_state* state) { u32 Mclk = state->config->mclk / 4096L; @@ -277,19 +266,6 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) return srate; } - - - - - - - - - - - - - static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { @@ -321,7 +297,6 @@ static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, return 0; } - static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -349,7 +324,6 @@ static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t return 0; } - static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -372,7 +346,6 @@ static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) } } - static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -412,7 +385,6 @@ static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag }; } - static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) { u8 last = 1; @@ -433,9 +405,7 @@ static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) for (i=0; i<9; i++) { if((cmd & 0x01) != last) { - stv0299_set_voltage(fe, - last ? SEC_VOLTAGE_13 : - SEC_VOLTAGE_18); + stv0299_set_voltage(fe, last ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); last = (last) ? 0 : 1; } @@ -448,7 +418,6 @@ static int stv0299_send_legacy_dish_cmd(struct dvb_frontend* fe, u32 cmd) return 0; } - static int stv0299_init (struct dvb_frontend* fe) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; @@ -468,7 +437,6 @@ static int stv0299_init (struct dvb_frontend* fe) return 0; } - static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) { struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/tda10021.c b/linux/drivers/media/dvb/frontends/tda10021.c index 72da8b69e..8bbcec71d 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.c +++ b/linux/drivers/media/dvb/frontends/tda10021.c @@ -1,4 +1,4 @@ -/* +/* TDA10021 - Single Chip Cable Channel Receiver driver module used on the the Siemens DVB-C cards @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +*/ #include <linux/config.h> #include <linux/delay.h> @@ -35,20 +35,16 @@ struct tda10021_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct tda10021_config* config; - struct dvb_frontend frontend; u8 pwm; u8 reg0; }; - + #if 0 #define dprintk(x...) printk(x) @@ -70,9 +66,9 @@ static u8 tda10021_inittab[0x40]= { 0x73, 0x6a, 0x23, 0x0a, 0x02, 0x37, 0x77, 0x1a, 0x37, 0x6a, 0x17, 0x8a, 0x1e, 0x86, 0x43, 0x40, - 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, + 0xb8, 0x3f, 0xa1, 0x00, 0xcd, 0x01, 0x00, 0xff, 0x11, 0x00, 0x7c, 0x31, 0x30, 0x20, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x33, 0x11, 0x0d, 0x95, 0x08, 0x58, 0x00, 0x00, 0x80, 0x00, 0x80, 0xff, 0x00, 0x00, 0x04, 0x2d, 0x2f, 0xff, 0x00, 0x00, 0x00, 0x00, @@ -94,7 +90,6 @@ static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data) return (ret != 1) ? -EREMOTEIO : 0; } - static u8 tda10021_readreg (struct tda10021_state* state, u8 reg) { u8 b0 [] = { reg }; @@ -115,7 +110,7 @@ static int lock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] | 0x80 }; struct i2c_msg msg = {.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg, 1) != 1) { printk("tda10021: lock tuner fails\n"); @@ -129,7 +124,7 @@ static int unlock_tuner(struct tda10021_state* state) { u8 buf[2] = { 0x0f, tda10021_inittab[0x0f] & 0x7f }; struct i2c_msg msg_post={.addr=state->config->demod_address, .flags=0, .buf=buf, .len=2}; - + if(i2c_transfer(state->i2c, &msg_post, 1) != 1) { printk("tda10021: unlock tuner fails\n"); @@ -142,12 +137,12 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, fe_spectral_inversion_t inversion) { reg0 |= state->reg0 & 0x63; - + if (INVERSION_ON == inversion) ENABLE_INVERSION(reg0); else if (INVERSION_OFF == inversion) DISABLE_INVERSION(reg0); - + tda10021_writereg (state, 0x00, reg0 & 0xfe); tda10021_writereg (state, 0x00, reg0 | 0x01); @@ -157,13 +152,13 @@ static int tda10021_setup_reg0 (struct tda10021_state* state, u8 reg0, static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate) { - s32 BDR; + s32 BDR; s32 BDRI; s16 SFIL=0; u16 NDEC = 0; u32 tmp, ratio; - if (symbolrate > XIN/2) + if (symbolrate > XIN/2) symbolrate = XIN/2; if (symbolrate < 500000) symbolrate = 500000; @@ -171,7 +166,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < XIN/16) NDEC = 1; if (symbolrate < XIN/32) NDEC = 2; if (symbolrate < XIN/64) NDEC = 3; - + if (symbolrate < (u32)(XIN/12.3)) SFIL = 1; if (symbolrate < (u32)(XIN/16)) SFIL = 0; if (symbolrate < (u32)(XIN/24.6)) SFIL = 1; @@ -179,22 +174,22 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate if (symbolrate < (u32)(XIN/49.2)) SFIL = 1; if (symbolrate < (u32)(XIN/64)) SFIL = 0; if (symbolrate < (u32)(XIN/98.4)) SFIL = 1; - + symbolrate <<= NDEC; ratio = (symbolrate << 4) / FIN; tmp = ((symbolrate << 4) % FIN) << 8; ratio = (ratio << 8) + tmp / FIN; tmp = (tmp % FIN) << 8; ratio = (ratio << 8) + (tmp + FIN/2) / FIN; - + BDR = ratio; BDRI = (((XIN << 5) / symbolrate) + 1) / 2; - - if (BDRI > 0xFF) + + if (BDRI > 0xFF) BDRI = 0xFF; - + SFIL = (SFIL << 4) | tda10021_inittab[0x0E]; - + NDEC = (NDEC << 6) | tda10021_inittab[0x03]; tda10021_writereg (state, 0x03, NDEC); @@ -208,20 +203,11 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate return 0; } - - - - - - - - - static int tda10021_init (struct dvb_frontend *fe) { struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int i; - + dprintk("DVB: TDA10021(%d): init chip\n", fe->adapter->num); //tda10021_writereg (fe, 0, 0); @@ -230,13 +216,13 @@ static int tda10021_init (struct dvb_frontend *fe) tda10021_writereg (state, i, tda10021_inittab[i]); tda10021_writereg (state, 0x34, state->pwm); - + //Comment by markus //0x2A[3-0] == PDIV -> P multiplaying factor (P=PDIV+1)(default 0) //0x2A[4] == BYPPLL -> Power down mode (default 1) //0x2A[5] == LCK -> PLL Lock Flag //0x2A[6] == POLAXIN -> Polarity of the input reference clock (default 0) - + //Activate PLL tda10021_writereg(state, 0x2a, tda10021_inittab[0x2a] & 0xef); @@ -255,7 +241,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; //table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 - //CONF + //CONF static const u8 reg0x00 [] = { 0x14, 0x00, 0x04, 0x08, 0x0c, 0x10 }; //AGCREF value static const u8 reg0x01 [] = { 0x78, 0x8c, 0x8c, 0x6a, 0x78, 0x5c }; @@ -265,7 +251,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, static const u8 reg0x08 [] = { 0x8c, 0xa2, 0x74, 0x43, 0x34, 0x23 }; //AREF static const u8 reg0x09 [] = { 0x96, 0x91, 0x96, 0x6a, 0x7e, 0x6b }; - + int qam = p->u.qam.modulation; if (qam < 0 || qam > 5) @@ -320,8 +306,8 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; u32 _ber = tda10021_readreg(state, 0x14) | - (tda10021_readreg(state, 0x15) << 8) | - ((tda10021_readreg(state, 0x16) & 0x0f) << 16); + (tda10021_readreg(state, 0x15) << 8) | + ((tda10021_readreg(state, 0x16) & 0x0f) << 16); *ber = 10 * _ber; return 0; @@ -367,7 +353,7 @@ static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; int sync; s8 afc = 0; - + sync = tda10021_readreg(state, 0x11); afc = tda10021_readreg(state, 0x19); if (verbose) { @@ -454,7 +440,7 @@ static struct dvb_frontend_ops tda10021_ops = { #endif .caps = 0x400 | //FE_CAN_QAM_4 FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 | - FE_CAN_QAM_128 | FE_CAN_QAM_256 | + FE_CAN_QAM_128 | FE_CAN_QAM_256 | FE_CAN_FEC_AUTO }, diff --git a/linux/drivers/media/dvb/frontends/tda10021.h b/linux/drivers/media/dvb/frontends/tda10021.h index fd9a5b9f8..7d6a51ce2 100644 --- a/linux/drivers/media/dvb/frontends/tda10021.h +++ b/linux/drivers/media/dvb/frontends/tda10021.h @@ -1,4 +1,4 @@ -/* +/* TDA10021 - Single Chip Cable Channel Receiver driver module used on the the Siemens DVB-C cards @@ -37,7 +37,6 @@ struct tda10021_config }; extern struct dvb_frontend* tda10021_attach(const struct tda10021_config* config, - struct i2c_adapter* i2c, - u8 pwm); + struct i2c_adapter* i2c, u8 pwm); #endif // TDA10021_H diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c index 47c90d6e0..0860e895a 100644 --- a/linux/drivers/media/dvb/frontends/tda1004x.c +++ b/linux/drivers/media/dvb/frontends/tda1004x.c @@ -39,19 +39,14 @@ #define TDA1004X_DEMOD_TDA10046 1 -struct tda1004x_state -{ +struct tda1004x_state { struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - const struct tda1004x_config* config; - struct dvb_frontend frontend; /* private demod data */ u8 initialised:1; - u8 demod_type; }; @@ -347,7 +342,6 @@ static int tda1004x_check_upload_ok(struct tda1004x_state *state, u8 dspVersion) return 0; } - static int tda10045_fwupload(struct dvb_frontend* fe) { struct tda1004x_state* state = fe->demodulator_priv; @@ -363,7 +357,7 @@ static int tda10045_fwupload(struct dvb_frontend* fe) ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE); if (ret) { printk("tda1004x: no firmware upload (timeout or file not found?)\n"); - return ret; + return ret; } /* reset chip */ @@ -407,7 +401,7 @@ static int tda10046_fwupload(struct dvb_frontend* fe) ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE); if (ret) { printk("tda1004x: no firmware upload (timeout or file not found?)\n"); - return ret; + return ret; } /* set parameters */ @@ -476,23 +470,6 @@ static int tda1004x_decode_fec(int tdafec) return -1; } - - - - - - - - - - - - - - - - - int tda1004x_write_byte(struct dvb_frontend* fe, int reg, int data) { struct tda1004x_state* state = fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/tda8083.c b/linux/drivers/media/dvb/frontends/tda8083.c index 03c4366e1..db6624b9f 100644 --- a/linux/drivers/media/dvb/frontends/tda8083.c +++ b/linux/drivers/media/dvb/frontends/tda8083.c @@ -35,14 +35,10 @@ struct tda8083_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct tda8083_config* config; - struct dvb_frontend frontend; }; @@ -78,7 +74,6 @@ static int tda8083_writereg (struct tda8083_state* state, u8 reg, u8 data) return (ret != 1) ? -1 : 0; } - static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len) { int ret; @@ -94,7 +89,6 @@ static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len return ret == 2 ? 0 : -1; } - static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg) { u8 val; @@ -104,8 +98,6 @@ static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg) return val; } - - static int tda8083_set_inversion (struct tda8083_state* state, fe_spectral_inversion_t inversion) { /* XXX FIXME: implement other modes than FEC_AUTO */ @@ -115,7 +107,6 @@ static int tda8083_set_inversion (struct tda8083_state* state, fe_spectral_inver return -EINVAL; } - static int tda8083_set_fec (struct tda8083_state* state, fe_code_rate_t fec) { if (fec == FEC_AUTO) @@ -127,7 +118,6 @@ static int tda8083_set_fec (struct tda8083_state* state, fe_code_rate_t fec) return -EINVAL; } - static fe_code_rate_t tda8083_get_fec (struct tda8083_state* state) { u8 index; @@ -139,7 +129,6 @@ static fe_code_rate_t tda8083_get_fec (struct tda8083_state* state) return fec_tab [index]; } - static int tda8083_set_symbolrate (struct tda8083_state* state, u32 srate) { u32 ratio; @@ -179,7 +168,6 @@ static int tda8083_set_symbolrate (struct tda8083_state* state, u32 srate) return 1; } - static void tda8083_wait_diseqc_fifo (struct tda8083_state* state, int timeout) { unsigned long start = jiffies; @@ -205,7 +193,6 @@ static int tda8083_set_tone (struct tda8083_state* state, fe_sec_tone_mode_t ton }; } - static int tda8083_set_voltage (struct tda8083_state* state, fe_sec_voltage_t voltage) { switch (voltage) { @@ -236,27 +223,6 @@ static int tda8083_send_diseqc_burst (struct tda8083_state* state, fe_sec_mini_c return 0; } - - - - - - - - - - - - - - - - - - - - - static int tda8083_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { @@ -475,9 +441,9 @@ static struct dvb_frontend_ops tda8083_ops = { .read_snr = tda8083_read_snr, .diseqc_send_master_cmd = tda8083_send_diseqc_msg, - .diseqc_send_burst = tda8083_diseqc_send_burst, - .set_tone = tda8083_diseqc_set_tone, - .set_voltage = tda8083_diseqc_set_voltage, + .diseqc_send_burst = tda8083_diseqc_send_burst, + .set_tone = tda8083_diseqc_set_tone, + .set_voltage = tda8083_diseqc_set_voltage, }; module_param(debug, int, 0644); diff --git a/linux/drivers/media/dvb/frontends/tda80xx.c b/linux/drivers/media/dvb/frontends/tda80xx.c index 5b8828b27..3d552c34f 100644 --- a/linux/drivers/media/dvb/frontends/tda80xx.c +++ b/linux/drivers/media/dvb/frontends/tda80xx.c @@ -204,8 +204,8 @@ static int tda80xx_set_parameters(struct tda80xx_state* state, * r = k * clk / symbol_rate * * k: 2^21 for caa 0..3, - * 2^20 for caa 4..5, - * 2^19 for caa 6..7 + * 2^20 for caa 4..5, + * 2^19 for caa 6..7 */ if (symbol_rate <= (clk * 3) / 32) k = (1 << 19); @@ -422,7 +422,7 @@ static int tda8044_init(struct dvb_frontend* fe) tda80xx_write(state, 0x00, tda8044_inittab_post, sizeof(tda8044_inittab_post)); if (state->config->pll_init) { - tda80xx_writereg(state, 0x1c, 0x80); + tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_init(fe); tda80xx_writereg(state, 0x1c, 0x00); } @@ -437,7 +437,7 @@ static int tda8083_init(struct dvb_frontend* fe) tda80xx_write(state, 0x00, tda8083_inittab, sizeof(tda8083_inittab)); if (state->config->pll_init) { - tda80xx_writereg(state, 0x1c, 0x80); + tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_init(fe); tda80xx_writereg(state, 0x1c, 0x00); } @@ -445,21 +445,6 @@ static int tda8083_init(struct dvb_frontend* fe) return 0; } - - - - - - - - - - - - - - - static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) { struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; @@ -492,7 +477,7 @@ static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) { - struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; + struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; if (cmd->msg_len > 6) return -EINVAL; @@ -536,7 +521,7 @@ static int tda80xx_sleep(struct dvb_frontend* fe) static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { - struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; + struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; tda80xx_writereg(state, 0x1c, 0x80); state->config->pll_set(fe, p); @@ -735,9 +720,9 @@ static struct dvb_frontend_ops tda80xx_ops = { .read_ucblocks = tda80xx_read_ucblocks, .diseqc_send_master_cmd = tda80xx_send_diseqc_msg, - .diseqc_send_burst = tda80xx_send_diseqc_burst, - .set_tone = tda80xx_set_tone, - .set_voltage = tda80xx_set_voltage, + .diseqc_send_burst = tda80xx_send_diseqc_burst, + .set_tone = tda80xx_set_tone, + .set_voltage = tda80xx_set_voltage, }; module_param(debug, int, 0644); diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index acd340ad8..62945ef1f 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -34,14 +34,10 @@ struct ves1820_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct ves1820_config* config; - struct dvb_frontend frontend; /* private demodulator data */ @@ -97,7 +93,6 @@ static u8 ves1820_readreg(struct ves1820_state *state, u8 reg) return b1[0]; } - static int ves1820_setup_reg0(struct ves1820_state *state, u8 reg0, fe_spectral_inversion_t inversion) { reg0 |= state->reg0 & 0x62; @@ -105,10 +100,8 @@ static int ves1820_setup_reg0(struct ves1820_state *state, u8 reg0, fe_spectral_ if (INVERSION_ON == inversion) { if (!state->config->invert) reg0 |= 0x20; else reg0 &= ~0x20; - } else if (INVERSION_OFF == inversion) { - - if (!state->config->invert) reg0 &= ~0x20; + if (!state->config->invert) reg0 &= ~0x20; else reg0 |= 0x20; } @@ -198,18 +191,6 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) return 0; } - - - - - - - - - - - - static int ves1820_init(struct dvb_frontend* fe) { struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; diff --git a/linux/drivers/media/dvb/frontends/ves1820.h b/linux/drivers/media/dvb/frontends/ves1820.h index 8739fec48..355f130b1 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.h +++ b/linux/drivers/media/dvb/frontends/ves1820.h @@ -46,7 +46,6 @@ struct ves1820_config }; extern struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, - struct i2c_adapter* i2c, - u8 pwm); + struct i2c_adapter* i2c, u8 pwm); #endif // VES1820_H diff --git a/linux/drivers/media/dvb/frontends/ves1x93.c b/linux/drivers/media/dvb/frontends/ves1x93.c index 1c511ef6b..b97861c5a 100644 --- a/linux/drivers/media/dvb/frontends/ves1x93.c +++ b/linux/drivers/media/dvb/frontends/ves1x93.c @@ -35,14 +35,10 @@ struct ves1x93_state { - struct i2c_adapter* i2c; - struct dvb_frontend_ops ops; - /* configuration settings */ const struct ves1x93_config* config; - struct dvb_frontend frontend; /* previous uncorrected block counter */ @@ -69,7 +65,6 @@ static u8 init_1893_tab [] = { 0x00, 0x55, 0x00, 0x00, 0x7f, 0x00 }; - static u8 init_1993_tab [] = { 0x00, 0x9c, 0x35, 0x80, 0x6a, 0x09, 0x72, 0x8c, 0x09, 0x6b, 0x00, 0x00, 0x4c, 0x08, 0x00, 0x00, @@ -89,7 +84,6 @@ static u8 init_1893_wtab[] = 1,1,1,0,1,1 }; - static u8 init_1993_wtab[] = { 1,1,1,1,1,1,1,1, 1,1,0,0,1,1,0,0, @@ -112,7 +106,6 @@ static int ves1x93_writereg (struct ves1x93_state* state, u8 reg, u8 data) return 0; } - static u8 ves1x93_readreg (struct ves1x93_state* state, u8 reg) { int ret; @@ -163,7 +156,6 @@ static int ves1x93_set_inversion (struct ves1x93_state* state, fe_spectral_inver return ves1x93_writereg (state, 0x0c, (state->init_1x93_tab[0x0c] & 0x3f) | val); } - static int ves1x93_set_fec (struct ves1x93_state* state, fe_code_rate_t fec) { if (fec == FEC_AUTO) @@ -174,13 +166,11 @@ static int ves1x93_set_fec (struct ves1x93_state* state, fe_code_rate_t fec) return ves1x93_writereg (state, 0x0d, fec - FEC_1_2); } - static fe_code_rate_t ves1x93_get_fec (struct ves1x93_state* state) { return FEC_1_2 + ((ves1x93_readreg (state, 0x0d) >> 4) & 0x7); } - static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) { u32 BDR; @@ -256,7 +246,7 @@ static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) AGCR = state->init_1x93_tab[0x05]; if (state->config->invert_pwm) AGCR |= 0x20; - + if (srate < 6000000) AGCR |= 0x80; else @@ -271,20 +261,6 @@ static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) return 0; } - - - - - - - - - - - - - - static int ves1x93_init (struct dvb_frontend* fe) { struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; @@ -349,6 +325,7 @@ static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) } *status = 0; + if (sync & 1) *status |= FE_HAS_SIGNAL; @@ -367,7 +344,6 @@ static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) return 0; } - static int ves1x93_read_ber(struct dvb_frontend* fe, u32* ber) { struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; |