struct cx24120_tuning {
u32 frequency;
u32 symbol_rate;
- fe_spectral_inversion_t inversion;
- fe_code_rate_t fec;
+ enum fe_spectral_inversion inversion;
+ enum fe_code_rate fec;
- fe_delivery_system_t delsys;
- fe_modulation_t modulation;
- fe_pilot_t pilot;
+ enum fe_delivery_system delsys;
+ enum fe_modulation modulation;
+ enum fe_pilot pilot;
/* Demod values */
u8 fec_val;
struct cx24120_tuning dcur;
struct cx24120_tuning dnxt;
- fe_status_t fe_status;
+ enum fe_status fe_status;
/* dvbv5 stats calculations */
u32 bitrate;
u32 berw_usecs;
u32 ber_prev;
- u32 per_prev;
+ u32 ucb_offset;
unsigned long ber_jiffies_stats;
unsigned long per_jiffies_stats;
};
}
static int cx24120_diseqc_send_burst(struct dvb_frontend *fe,
- fe_sec_mini_cmd_t burst)
+ enum fe_sec_mini_cmd burst)
{
struct cx24120_state *state = fe->demodulator_priv;
struct cx24120_cmd cmd;
return cx24120_message_send(state, &cmd);
}
-static int cx24120_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
+static int cx24120_set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone)
{
struct cx24120_state *state = fe->demodulator_priv;
struct cx24120_cmd cmd;
}
static int cx24120_set_voltage(struct dvb_frontend *fe,
- fe_sec_voltage_t voltage)
+ enum fe_sec_voltage voltage)
{
struct cx24120_state *state = fe->demodulator_priv;
struct cx24120_cmd cmd;
ucb |= cx24120_readreg(state, CX24120_REG_UCB_L);
dev_dbg(&state->i2c->dev, "ucblocks = %d\n", ucb);
+ /* handle reset */
+ if (ucb < state->ucb_offset)
+ state->ucb_offset = c->block_error.stat[0].uvalue;
+
c->block_error.stat[0].scale = FE_SCALE_COUNTER;
- c->block_error.stat[0].uvalue += ucb;
+ c->block_error.stat[0].uvalue = ucb + state->ucb_offset;
c->block_count.stat[0].scale = FE_SCALE_COUNTER;
c->block_count.stat[0].uvalue += state->bitrate / 8 / 208;
static void cx24120_set_clock_ratios(struct dvb_frontend *fe);
/* Read current tuning status */
-static int cx24120_read_status(struct dvb_frontend *fe, fe_status_t *status)
+static int cx24120_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx24120_state *state = fe->demodulator_priv;
int lock;
* once tuned in.
*/
struct cx24120_modfec {
- fe_delivery_system_t delsys;
- fe_modulation_t mod;
- fe_code_rate_t fec;
+ enum fe_delivery_system delsys;
+ enum fe_modulation mod;
+ enum fe_code_rate fec;
u8 val;
};
}
/* Calculate ber window time */
-void cx24120_calculate_ber_window(struct cx24120_state *state, u32 rate)
+static void cx24120_calculate_ber_window(struct cx24120_state *state, u32 rate)
{
struct dvb_frontend *fe = &state->frontend;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
* can't determine the pattern
*/
struct cx24120_clock_ratios_table {
- fe_delivery_system_t delsys;
- fe_pilot_t pilot;
- fe_modulation_t mod;
- fe_code_rate_t fec;
+ enum fe_delivery_system delsys;
+ enum fe_pilot pilot;
+ enum fe_modulation mod;
+ enum fe_code_rate fec;
u32 m_rat;
u32 n_rat;
u32 rate;
/* Set inversion value */
static int cx24120_set_inversion(struct cx24120_state *state,
- fe_spectral_inversion_t inversion)
+ enum fe_spectral_inversion inversion)
{
dev_dbg(&state->i2c->dev, "(%d)\n", inversion);
/* FEC lookup table for tuning */
struct cx24120_modfec_table {
- fe_delivery_system_t delsys;
- fe_modulation_t mod;
- fe_code_rate_t fec;
+ enum fe_delivery_system delsys;
+ enum fe_modulation mod;
+ enum fe_code_rate fec;
u8 val;
};
};
/* Set fec_val & fec_mask values from delsys, modulation & fec */
-static int cx24120_set_fec(struct cx24120_state *state, fe_modulation_t mod,
- fe_code_rate_t fec)
+static int cx24120_set_fec(struct cx24120_state *state, enum fe_modulation mod,
+ enum fe_code_rate fec)
{
int idx;
}
/* Set pilot */
-static int cx24120_set_pilot(struct cx24120_state *state, fe_pilot_t pilot)
+static int cx24120_set_pilot(struct cx24120_state *state, enum fe_pilot pilot)
{
dev_dbg(&state->i2c->dev, "(%d)\n", pilot);
c->block_count.len = 1;
c->block_count.stat[0].scale = FE_SCALE_NOT_AVAILABLE;
-
state->cold_init = 1;
+
return 0;
}
static int cx24120_tune(struct dvb_frontend *fe, bool re_tune,
unsigned int mode_flags, unsigned int *delay,
- fe_status_t *status)
+ enum fe_status *status)
{
struct cx24120_state *state = fe->demodulator_priv;
int ret;
return 0;
}
- *ucblocks = c->block_error.stat[0].uvalue - state->per_prev;
- state->per_prev = c->block_error.stat[0].uvalue;
+ *ucblocks = c->block_error.stat[0].uvalue - state->ucb_offset;
return 0;
}