Lines Matching refs:state
62 static int ix2505v_read_status_reg(struct ix2505v_state *state) in ix2505v_read_status_reg() argument
64 u8 addr = state->config->tuner_address; in ix2505v_read_status_reg()
72 ret = i2c_transfer(state->i2c, msg, 1); in ix2505v_read_status_reg()
78 static int ix2505v_write(struct ix2505v_state *state, u8 buf[], u8 count) in ix2505v_write() argument
81 { .addr = state->config->tuner_address, .flags = 0, in ix2505v_write()
87 ret = i2c_transfer(state->i2c, msg, 1); in ix2505v_write()
99 struct ix2505v_state *state = fe->tuner_priv; in ix2505v_release() local
102 kfree(state); in ix2505v_release()
135 struct ix2505v_state *state = fe->tuner_priv; in ix2505v_set_params() local
147 if (state->config->tuner_gain) in ix2505v_set_params()
148 gain = (state->config->tuner_gain < 4) in ix2505v_set_params()
149 ? state->config->tuner_gain : 0; in ix2505v_set_params()
153 if (state->config->tuner_chargepump) in ix2505v_set_params()
154 cc = state->config->tuner_chargepump; in ix2505v_set_params()
221 ret |= ix2505v_write(state, data, len); in ix2505v_set_params()
229 ret |= ix2505v_write(state, &data[2], len); /* write byte 4 only */ in ix2505v_set_params()
242 ret |= ix2505v_write(state, &data[2], len); /* write byte 4 & 5 */ in ix2505v_set_params()
244 if (state->config->min_delay_ms) in ix2505v_set_params()
245 msleep(state->config->min_delay_ms); in ix2505v_set_params()
247 state->frequency = frequency; in ix2505v_set_params()
254 struct ix2505v_state *state = fe->tuner_priv; in ix2505v_get_frequency() local
256 *frequency = state->frequency; in ix2505v_get_frequency()
276 struct ix2505v_state *state = NULL; in ix2505v_attach() local
284 state = kzalloc(sizeof(struct ix2505v_state), GFP_KERNEL); in ix2505v_attach()
285 if (NULL == state) in ix2505v_attach()
288 state->config = config; in ix2505v_attach()
289 state->i2c = i2c; in ix2505v_attach()
291 if (state->config->tuner_write_only) { in ix2505v_attach()
295 ret = ix2505v_read_status_reg(state); in ix2505v_attach()
306 fe->tuner_priv = state; in ix2505v_attach()
316 kfree(state); in ix2505v_attach()