Lines Matching refs:state

45 static int mxl111sf_demod_read_reg(struct mxl111sf_demod_state *state,  in mxl111sf_demod_read_reg()  argument
48 return (state->cfg->read_reg) ? in mxl111sf_demod_read_reg()
49 state->cfg->read_reg(state->mxl_state, addr, data) : in mxl111sf_demod_read_reg()
53 static int mxl111sf_demod_write_reg(struct mxl111sf_demod_state *state, in mxl111sf_demod_write_reg() argument
56 return (state->cfg->write_reg) ? in mxl111sf_demod_write_reg()
57 state->cfg->write_reg(state->mxl_state, addr, data) : in mxl111sf_demod_write_reg()
62 int mxl111sf_demod_program_regs(struct mxl111sf_demod_state *state, in mxl111sf_demod_program_regs() argument
65 return (state->cfg->program_regs) ? in mxl111sf_demod_program_regs()
66 state->cfg->program_regs(state->mxl_state, ctrl_reg_info) : in mxl111sf_demod_program_regs()
74 int mxl1x1sf_demod_get_tps_code_rate(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_code_rate() argument
78 int ret = mxl111sf_demod_read_reg(state, V6_CODE_RATE_TPS_REG, &val); in mxl1x1sf_demod_get_tps_code_rate()
105 int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_modulation() argument
109 int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val); in mxl1x1sf_demod_get_tps_modulation()
130 int mxl1x1sf_demod_get_tps_guard_fft_mode(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_guard_fft_mode() argument
134 int ret = mxl111sf_demod_read_reg(state, V6_MODE_TPS_REG, &val); in mxl1x1sf_demod_get_tps_guard_fft_mode()
155 int mxl1x1sf_demod_get_tps_guard_interval(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_guard_interval() argument
159 int ret = mxl111sf_demod_read_reg(state, V6_CP_TPS_REG, &val); in mxl1x1sf_demod_get_tps_guard_interval()
183 int mxl1x1sf_demod_get_tps_hierarchy(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_hierarchy() argument
187 int ret = mxl111sf_demod_read_reg(state, V6_TPS_HIERACHY_REG, &val); in mxl1x1sf_demod_get_tps_hierarchy()
214 int mxl1x1sf_demod_get_sync_lock_status(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_sync_lock_status() argument
218 int ret = mxl111sf_demod_read_reg(state, V6_SYNC_LOCK_REG, &val); in mxl1x1sf_demod_get_sync_lock_status()
227 int mxl1x1sf_demod_get_rs_lock_status(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_rs_lock_status() argument
231 int ret = mxl111sf_demod_read_reg(state, V6_RS_LOCK_DET_REG, &val); in mxl1x1sf_demod_get_rs_lock_status()
240 int mxl1x1sf_demod_get_tps_lock_status(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_tps_lock_status() argument
244 int ret = mxl111sf_demod_read_reg(state, V6_TPS_LOCK_REG, &val); in mxl1x1sf_demod_get_tps_lock_status()
253 int mxl1x1sf_demod_get_fec_lock_status(struct mxl111sf_demod_state *state, in mxl1x1sf_demod_get_fec_lock_status() argument
257 int ret = mxl111sf_demod_read_reg(state, V6_IRQ_STATUS_REG, &val); in mxl1x1sf_demod_get_fec_lock_status()
267 int mxl1x1sf_demod_get_cp_lock_status(struct mxl111sf_demod_state *state,
271 int ret = mxl111sf_demod_read_reg(state, V6_CP_LOCK_DET_REG, &val);
280 static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state) in mxl1x1sf_demod_reset_irq_status() argument
282 return mxl111sf_demod_write_reg(state, 0x0e, 0xff); in mxl1x1sf_demod_reset_irq_status()
289 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_set_frontend() local
310 ret = mxl111sf_demod_program_regs(state, phy_pll_patch); in mxl111sf_demod_set_frontend()
313 ret = mxl1x1sf_demod_reset_irq_status(state); in mxl111sf_demod_set_frontend()
326 int mxl1x1sf_demod_reset_packet_error_count(struct mxl111sf_demod_state *state)
333 return mxl111sf_demod_program_regs(state, reset_per_count);
341 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_read_ucblocks() local
349 ret = mxl111sf_demod_read_reg(state, V6_FEC_PER_COUNT_REG, &val); in mxl111sf_demod_read_ucblocks()
356 ret = mxl111sf_demod_read_reg(state, V6_FEC_PER_SCALE_REG, &val); in mxl111sf_demod_read_ucblocks()
389 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_read_ber() local
395 ret = mxl111sf_demod_read_reg(state, V6_RS_AVG_ERRORS_LSB_REG, &val1); in mxl111sf_demod_read_ber()
398 ret = mxl111sf_demod_read_reg(state, V6_RS_AVG_ERRORS_MSB_REG, &val2); in mxl111sf_demod_read_ber()
401 ret = mxl111sf_demod_read_reg(state, V6_N_ACCUMULATE_REG, &val3); in mxl111sf_demod_read_ber()
410 static int mxl111sf_demod_calc_snr(struct mxl111sf_demod_state *state, in mxl111sf_demod_calc_snr() argument
418 ret = mxl111sf_demod_read_reg(state, V6_SNR_RB_LSB_REG, &val1); in mxl111sf_demod_calc_snr()
421 ret = mxl111sf_demod_read_reg(state, V6_SNR_RB_MSB_REG, &val2); in mxl111sf_demod_calc_snr()
432 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_read_snr() local
434 int ret = mxl111sf_demod_calc_snr(state, snr); in mxl111sf_demod_read_snr()
446 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_read_status() local
451 ret = mxl1x1sf_demod_get_rs_lock_status(state, &locked); in mxl111sf_demod_read_status()
454 ret = mxl1x1sf_demod_get_tps_lock_status(state, &cr_lock); in mxl111sf_demod_read_status()
457 ret = mxl1x1sf_demod_get_sync_lock_status(state, &sync_lock); in mxl111sf_demod_read_status()
460 ret = mxl1x1sf_demod_get_fec_lock_status(state, &fec_lock); in mxl111sf_demod_read_status()
482 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_read_signal_strength() local
486 mxl111sf_demod_calc_snr(state, &snr); in mxl111sf_demod_read_signal_strength()
487 mxl1x1sf_demod_get_tps_modulation(state, &modulation); in mxl111sf_demod_read_signal_strength()
513 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_get_frontend() local
523 mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_HP); in mxl111sf_demod_get_frontend()
524 mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_LP); in mxl111sf_demod_get_frontend()
525 mxl1x1sf_demod_get_tps_modulation(state, &p->modulation); in mxl111sf_demod_get_frontend()
526 mxl1x1sf_demod_get_tps_guard_fft_mode(state, in mxl111sf_demod_get_frontend()
528 mxl1x1sf_demod_get_tps_guard_interval(state, in mxl111sf_demod_get_frontend()
530 mxl1x1sf_demod_get_tps_hierarchy(state, in mxl111sf_demod_get_frontend()
546 struct mxl111sf_demod_state *state = fe->demodulator_priv; in mxl111sf_demod_release() local
548 kfree(state); in mxl111sf_demod_release()
584 struct mxl111sf_demod_state *state = NULL; in mxl111sf_demod_attach() local
588 state = kzalloc(sizeof(struct mxl111sf_demod_state), GFP_KERNEL); in mxl111sf_demod_attach()
589 if (state == NULL) in mxl111sf_demod_attach()
592 state->mxl_state = mxl_state; in mxl111sf_demod_attach()
593 state->cfg = cfg; in mxl111sf_demod_attach()
595 memcpy(&state->fe.ops, &mxl111sf_demod_ops, in mxl111sf_demod_attach()
598 state->fe.demodulator_priv = state; in mxl111sf_demod_attach()
599 return &state->fe; in mxl111sf_demod_attach()