Lines Matching defs:state

32 static int mxl111sf_demod_read_reg(struct mxl111sf_demod_state *state,
35 return (state->cfg->read_reg) ?
36 state->cfg->read_reg(state->mxl_state, addr, data) :
40 static int mxl111sf_demod_write_reg(struct mxl111sf_demod_state *state,
43 return (state->cfg->write_reg) ?
44 state->cfg->write_reg(state->mxl_state, addr, data) :
49 int mxl111sf_demod_program_regs(struct mxl111sf_demod_state *state,
52 return (state->cfg->program_regs) ?
53 state->cfg->program_regs(state->mxl_state, ctrl_reg_info) :
61 int mxl1x1sf_demod_get_tps_code_rate(struct mxl111sf_demod_state *state,
65 int ret = mxl111sf_demod_read_reg(state, V6_CODE_RATE_TPS_REG, &val);
92 int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state,
96 int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val);
117 int mxl1x1sf_demod_get_tps_guard_fft_mode(struct mxl111sf_demod_state *state,
121 int ret = mxl111sf_demod_read_reg(state, V6_MODE_TPS_REG, &val);
142 int mxl1x1sf_demod_get_tps_guard_interval(struct mxl111sf_demod_state *state,
146 int ret = mxl111sf_demod_read_reg(state, V6_CP_TPS_REG, &val);
170 int mxl1x1sf_demod_get_tps_hierarchy(struct mxl111sf_demod_state *state,
174 int ret = mxl111sf_demod_read_reg(state, V6_TPS_HIERACHY_REG, &val);
201 int mxl1x1sf_demod_get_sync_lock_status(struct mxl111sf_demod_state *state,
205 int ret = mxl111sf_demod_read_reg(state, V6_SYNC_LOCK_REG, &val);
214 int mxl1x1sf_demod_get_rs_lock_status(struct mxl111sf_demod_state *state,
218 int ret = mxl111sf_demod_read_reg(state, V6_RS_LOCK_DET_REG, &val);
227 int mxl1x1sf_demod_get_tps_lock_status(struct mxl111sf_demod_state *state,
231 int ret = mxl111sf_demod_read_reg(state, V6_TPS_LOCK_REG, &val);
240 int mxl1x1sf_demod_get_fec_lock_status(struct mxl111sf_demod_state *state,
244 int ret = mxl111sf_demod_read_reg(state, V6_IRQ_STATUS_REG, &val);
254 int mxl1x1sf_demod_get_cp_lock_status(struct mxl111sf_demod_state *state,
258 int ret = mxl111sf_demod_read_reg(state, V6_CP_LOCK_DET_REG, &val);
267 static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state)
269 return mxl111sf_demod_write_reg(state, 0x0e, 0xff);
276 struct mxl111sf_demod_state *state = fe->demodulator_priv;
297 ret = mxl111sf_demod_program_regs(state, phy_pll_patch);
300 ret = mxl1x1sf_demod_reset_irq_status(state);
313 int mxl1x1sf_demod_reset_packet_error_count(struct mxl111sf_demod_state *state)
320 return mxl111sf_demod_program_regs(state, reset_per_count);
328 struct mxl111sf_demod_state *state = fe->demodulator_priv;
336 ret = mxl111sf_demod_read_reg(state, V6_FEC_PER_COUNT_REG, &val);
343 ret = mxl111sf_demod_read_reg(state, V6_FEC_PER_SCALE_REG, &val);
376 struct mxl111sf_demod_state *state = fe->demodulator_priv;
382 ret = mxl111sf_demod_read_reg(state, V6_RS_AVG_ERRORS_LSB_REG, &val1);
385 ret = mxl111sf_demod_read_reg(state, V6_RS_AVG_ERRORS_MSB_REG, &val2);
388 ret = mxl111sf_demod_read_reg(state, V6_N_ACCUMULATE_REG, &val3);
397 static int mxl111sf_demod_calc_snr(struct mxl111sf_demod_state *state,
405 ret = mxl111sf_demod_read_reg(state, V6_SNR_RB_LSB_REG, &val1);
408 ret = mxl111sf_demod_read_reg(state, V6_SNR_RB_MSB_REG, &val2);
419 struct mxl111sf_demod_state *state = fe->demodulator_priv;
421 int ret = mxl111sf_demod_calc_snr(state, snr);
433 struct mxl111sf_demod_state *state = fe->demodulator_priv;
438 ret = mxl1x1sf_demod_get_rs_lock_status(state, &locked);
441 ret = mxl1x1sf_demod_get_tps_lock_status(state, &cr_lock);
444 ret = mxl1x1sf_demod_get_sync_lock_status(state, &sync_lock);
447 ret = mxl1x1sf_demod_get_fec_lock_status(state, &fec_lock);
469 struct mxl111sf_demod_state *state = fe->demodulator_priv;
474 ret = mxl111sf_demod_calc_snr(state, &snr);
477 ret = mxl1x1sf_demod_get_tps_modulation(state, &modulation);
505 struct mxl111sf_demod_state *state = fe->demodulator_priv;
515 mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_HP);
516 mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_LP);
517 mxl1x1sf_demod_get_tps_modulation(state, &p->modulation);
518 mxl1x1sf_demod_get_tps_guard_fft_mode(state,
520 mxl1x1sf_demod_get_tps_guard_interval(state,
522 mxl1x1sf_demod_get_tps_hierarchy(state,
538 struct mxl111sf_demod_state *state = fe->demodulator_priv;
540 kfree(state);
576 struct mxl111sf_demod_state *state = NULL;
580 state = kzalloc(sizeof(struct mxl111sf_demod_state), GFP_KERNEL);
581 if (state == NULL)
584 state->mxl_state = mxl_state;
585 state->cfg = cfg;
587 memcpy(&state->fe.ops, &mxl111sf_demod_ops,
590 state->fe.demodulator_priv = state;
591 return &state->fe;