Lines Matching defs:state
234 struct au8522_state *state = fe->demodulator_priv;
262 au8522_writereg(state, 0x00b5, r0b5);
263 au8522_writereg(state, 0x00b6, r0b6);
264 au8522_writereg(state, 0x00b7, r0b7);
544 struct au8522_state *state = fe->demodulator_priv;
553 au8522_writereg(state,
556 au8522_set_if(fe, state->config.vsb_if);
561 au8522_writereg(state,
564 au8522_set_if(fe, state->config.qam_if);
570 au8522_writereg(state,
573 au8522_set_if(fe, state->config.qam_if);
575 au8522_writereg(state, 0x821a, 0x00);
579 au8522_writereg(state,
582 au8522_set_if(fe, state->config.qam_if);
590 state->current_modulation = m;
599 struct au8522_state *state = fe->demodulator_priv;
604 if ((state->current_frequency == c->frequency) &&
605 (state->current_modulation == c->modulation))
629 state->current_frequency = c->frequency;
636 struct au8522_state *state = fe->demodulator_priv;
642 if (state->current_modulation == VSB_8) {
644 reg = au8522_readreg(state, 0x0088);
649 reg = au8522_readreg(state, 0x0541);
656 switch (state->config.status_mode) {
678 state->fe_status = *status;
682 au8522_led_ctrl(state, -1);
685 au8522_led_ctrl(state, 0);
692 static int au8522_led_status(struct au8522_state *state, const u16 *snr)
694 struct au8522_led_config *led_config = state->config.led_cfg;
702 if (0 == (state->fe_status & FE_HAS_LOCK))
703 return au8522_led_ctrl(state, 0);
704 else if (state->current_modulation == QAM_256)
706 else if (state->current_modulation == QAM_64)
708 else /* (state->current_modulation == VSB_8) */
716 if ((state->led_state) &&
722 return au8522_led_ctrl(state, led);
727 struct au8522_state *state = fe->demodulator_priv;
732 if (state->current_modulation == QAM_256)
735 au8522_readreg(state, 0x0522),
737 else if (state->current_modulation == QAM_64)
740 au8522_readreg(state, 0x0522),
745 au8522_readreg(state, 0x0311),
748 if (state->config.led_cfg)
749 au8522_led_status(state, snr);
791 struct au8522_state *state = fe->demodulator_priv;
793 if (state->current_modulation == VSB_8)
794 *ucblocks = au8522_readreg(state, 0x0087);
796 *ucblocks = au8522_readreg(state, 0x0543);
809 struct au8522_state *state = fe->demodulator_priv;
811 c->frequency = state->current_frequency;
812 c->modulation = state->current_modulation;
829 struct au8522_state *state = fe->demodulator_priv;
830 au8522_release_state(state);
836 struct au8522_state *state = NULL;
839 /* allocate memory for the internal state */
840 instance = au8522_get_state(&state, i2c, config->demod_address);
843 dprintk("%s state allocation failed\n", __func__);
855 /* setup the state */
856 state->config = *config;
857 state->i2c = i2c;
858 state->operational_mode = AU8522_DIGITAL_MODE;
861 memcpy(&state->frontend.ops, &au8522_ops,
863 state->frontend.demodulator_priv = state;
865 state->frontend.ops.analog_ops.i2c_gate_ctrl = au8522_analog_i2c_gate_ctrl;
867 if (au8522_init(&state->frontend) != 0) {
874 au8522_i2c_gate_ctrl(&state->frontend, 1);
876 return &state->frontend;
879 au8522_release_state(state);