Lines Matching defs:state
30 int au8522_writereg(struct au8522_state *state, u16 reg, u8 data)
35 struct i2c_msg msg = { .addr = state->config.demod_address,
38 ret = i2c_transfer(state->i2c, &msg, 1);
48 u8 au8522_readreg(struct au8522_state *state, u16 reg)
55 { .addr = state->config.demod_address, .flags = 0,
57 { .addr = state->config.demod_address, .flags = I2C_M_RD,
60 ret = i2c_transfer(state->i2c, msg, 2);
71 struct au8522_state *state = fe->demodulator_priv;
75 if (state->operational_mode == AU8522_ANALOG_MODE) {
84 return au8522_writereg(state, 0x106, 1);
86 return au8522_writereg(state, 0x106, 0);
92 struct au8522_state *state = fe->demodulator_priv;
97 return au8522_writereg(state, 0x106, 1);
99 return au8522_writereg(state, 0x106, 0);
104 to a default state. */
105 int au8522_get_state(struct au8522_state **state, struct i2c_adapter *i2c,
111 ret = hybrid_tuner_request_state(struct au8522_state, (*state),
120 void au8522_release_state(struct au8522_state *state)
123 if (state != NULL)
124 hybrid_tuner_release_state(state);
129 static int au8522_led_gpio_enable(struct au8522_state *state, int onoff)
131 struct au8522_led_config *led_config = state->config.led_cfg;
139 val = au8522_readreg(state, 0x4000 |
150 return au8522_writereg(state, 0x8000 |
159 int au8522_led_ctrl(struct au8522_state *state, int led)
161 struct au8522_led_config *led_config = state->config.led_cfg;
171 if (state->led_state)
177 /* toggle LED if changing state */
178 if (state->led_state != led) {
183 au8522_led_gpio_enable(state, 1);
185 val = au8522_readreg(state, 0x4000 |
192 /* set selected LED state */
199 ret = au8522_writereg(state, 0x8000 |
204 state->led_state = led;
207 au8522_led_gpio_enable(state, 0);
216 struct au8522_state *state = fe->demodulator_priv;
219 state->operational_mode = AU8522_DIGITAL_MODE;
221 /* Clear out any state associated with the digital side of the
224 state->current_frequency = 0;
225 state->current_modulation = VSB_8;
227 au8522_writereg(state, 0xa4, 1 << 5);
237 struct au8522_state *state = fe->demodulator_priv;
241 if (state->operational_mode == AU8522_ANALOG_MODE) {
250 au8522_led_ctrl(state, 0);
253 au8522_writereg(state, 0xa4, 1 << 5);
255 state->current_frequency = 0;