Lines Matching refs:state

246 	struct au8522_state *state = fe->demodulator_priv;  in au8522_set_if()  local
274 au8522_writereg(state, 0x80b5, r0b5); in au8522_set_if()
275 au8522_writereg(state, 0x80b6, r0b6); in au8522_set_if()
276 au8522_writereg(state, 0x80b7, r0b7); in au8522_set_if()
557 struct au8522_state *state = fe->demodulator_priv; in au8522_enable_modulation() local
566 au8522_writereg(state, in au8522_enable_modulation()
569 au8522_set_if(fe, state->config->vsb_if); in au8522_enable_modulation()
574 au8522_writereg(state, in au8522_enable_modulation()
577 au8522_set_if(fe, state->config->qam_if); in au8522_enable_modulation()
583 au8522_writereg(state, in au8522_enable_modulation()
586 au8522_set_if(fe, state->config->qam_if); in au8522_enable_modulation()
588 au8522_writereg(state, 0x821a, 0x00); in au8522_enable_modulation()
592 au8522_writereg(state, in au8522_enable_modulation()
595 au8522_set_if(fe, state->config->qam_if); in au8522_enable_modulation()
603 state->current_modulation = m; in au8522_enable_modulation()
612 struct au8522_state *state = fe->demodulator_priv; in au8522_set_frontend() local
617 if ((state->current_frequency == c->frequency) && in au8522_set_frontend()
618 (state->current_modulation == c->modulation)) in au8522_set_frontend()
642 state->current_frequency = c->frequency; in au8522_set_frontend()
649 struct au8522_state *state = fe->demodulator_priv; in au8522_read_status() local
655 if (state->current_modulation == VSB_8) { in au8522_read_status()
657 reg = au8522_readreg(state, 0x4088); in au8522_read_status()
662 reg = au8522_readreg(state, 0x4541); in au8522_read_status()
669 switch (state->config->status_mode) { in au8522_read_status()
691 state->fe_status = *status; in au8522_read_status()
695 au8522_led_ctrl(state, -1); in au8522_read_status()
698 au8522_led_ctrl(state, 0); in au8522_read_status()
705 static int au8522_led_status(struct au8522_state *state, const u16 *snr) in au8522_led_status() argument
707 struct au8522_led_config *led_config = state->config->led_cfg; in au8522_led_status()
715 if (0 == (state->fe_status & FE_HAS_LOCK)) in au8522_led_status()
716 return au8522_led_ctrl(state, 0); in au8522_led_status()
717 else if (state->current_modulation == QAM_256) in au8522_led_status()
719 else if (state->current_modulation == QAM_64) in au8522_led_status()
729 if ((state->led_state) && in au8522_led_status()
735 return au8522_led_ctrl(state, led); in au8522_led_status()
740 struct au8522_state *state = fe->demodulator_priv; in au8522_read_snr() local
745 if (state->current_modulation == QAM_256) in au8522_read_snr()
748 au8522_readreg(state, 0x4522), in au8522_read_snr()
750 else if (state->current_modulation == QAM_64) in au8522_read_snr()
753 au8522_readreg(state, 0x4522), in au8522_read_snr()
758 au8522_readreg(state, 0x4311), in au8522_read_snr()
761 if (state->config->led_cfg) in au8522_read_snr()
762 au8522_led_status(state, snr); in au8522_read_snr()
804 struct au8522_state *state = fe->demodulator_priv; in au8522_read_ucblocks() local
806 if (state->current_modulation == VSB_8) in au8522_read_ucblocks()
807 *ucblocks = au8522_readreg(state, 0x4087); in au8522_read_ucblocks()
809 *ucblocks = au8522_readreg(state, 0x4543); in au8522_read_ucblocks()
822 struct au8522_state *state = fe->demodulator_priv; in au8522_get_frontend() local
824 c->frequency = state->current_frequency; in au8522_get_frontend()
825 c->modulation = state->current_modulation; in au8522_get_frontend()
842 struct au8522_state *state = fe->demodulator_priv; in au8522_release() local
843 au8522_release_state(state); in au8522_release()
849 struct au8522_state *state = NULL; in au8522_attach() local
853 instance = au8522_get_state(&state, i2c, config->demod_address); in au8522_attach()
869 state->config = config; in au8522_attach()
870 state->i2c = i2c; in au8522_attach()
871 state->operational_mode = AU8522_DIGITAL_MODE; in au8522_attach()
874 memcpy(&state->frontend.ops, &au8522_ops, in au8522_attach()
876 state->frontend.demodulator_priv = state; in au8522_attach()
878 state->frontend.ops.analog_ops.i2c_gate_ctrl = au8522_analog_i2c_gate_ctrl; in au8522_attach()
880 if (au8522_init(&state->frontend) != 0) { in au8522_attach()
887 au8522_i2c_gate_ctrl(&state->frontend, 1); in au8522_attach()
889 return &state->frontend; in au8522_attach()
892 au8522_release_state(state); in au8522_attach()