Lines Matching refs:state
59 static int zl10036_read_status_reg(struct zl10036_state *state)
63 { .addr = state->config->tuner_address, .flags = I2C_M_RD,
67 if (i2c_transfer(state->i2c, msg, 1) != 1) {
69 __func__, state->config->tuner_address);
82 static int zl10036_write(struct zl10036_state *state, u8 buf[], u8 count)
85 { .addr = state->config->tuner_address, .flags = 0,
116 ret = i2c_transfer(state->i2c, msg, 1);
127 struct zl10036_state *state = fe->tuner_priv;
130 kfree(state);
135 struct zl10036_state *state = fe->tuner_priv;
144 ret = zl10036_write(state, buf, sizeof(buf));
170 static int zl10036_set_frequency(struct zl10036_state *state, u32 frequency)
176 state->frequency = div * _FR;
178 foffset = frequency - state->frequency;
184 frequency, state->frequency, foffset, div);
186 return zl10036_write(state, buf, sizeof(buf));
189 static int zl10036_set_bandwidth(struct zl10036_state *state, u32 fbw)
241 if (br != state->br) {
242 ret = zl10036_write(state, buf_br, sizeof(buf_br));
247 if (bf != state->bf) {
248 ret = zl10036_write(state, buf_bf, sizeof(buf_bf));
257 ret = zl10036_write(state, zl10036_rsd_off,
263 state->br = br;
264 state->bf = bf;
269 static int zl10036_set_gain_params(struct zl10036_state *state,
284 if (!state->config->rf_loop_enable)
291 return zl10036_write(state, buf, sizeof(buf));
297 struct zl10036_state *state = fe->tuner_priv;
338 ret = zl10036_set_gain_params(state, c);
342 ret = zl10036_set_frequency(state, p->frequency);
346 ret = zl10036_set_bandwidth(state, fbw);
352 ret = zl10036_read_status_reg(state);
372 struct zl10036_state *state = fe->tuner_priv;
374 *frequency = state->frequency;
379 static int zl10036_init_regs(struct zl10036_state *state)
397 state->br = 0xff;
398 state->bf = 0xff;
400 if (!state->config->rf_loop_enable)
406 ret = zl10036_write(state, zl10036_init_tab[i], 2);
416 struct zl10036_state *state = fe->tuner_priv;
422 ret = zl10036_read_status_reg(state);
427 ret = zl10036_init_regs(state);
452 struct zl10036_state *state;
460 state = kzalloc(sizeof(struct zl10036_state), GFP_KERNEL);
461 if (!state)
464 state->config = config;
465 state->i2c = i2c;
470 ret = zl10036_read_status_reg(state);
476 ret = zl10036_init_regs(state);
486 fe->tuner_priv = state;
496 kfree(state);