Lines Matching defs:state
71 static int zl10036_read_status_reg(struct zl10036_state *state)
75 { .addr = state->config->tuner_address, .flags = I2C_M_RD,
79 if (i2c_transfer(state->i2c, msg, 1) != 1) {
81 __func__, state->config->tuner_address);
94 static int zl10036_write(struct zl10036_state *state, u8 buf[], u8 count)
97 { .addr = state->config->tuner_address, .flags = 0,
128 ret = i2c_transfer(state->i2c, msg, 1);
139 struct zl10036_state *state = fe->tuner_priv;
142 kfree(state);
149 struct zl10036_state *state = fe->tuner_priv;
158 ret = zl10036_write(state, buf, sizeof(buf));
184 static int zl10036_set_frequency(struct zl10036_state *state, u32 frequency)
190 state->frequency = div * _FR;
192 foffset = frequency - state->frequency;
198 frequency, state->frequency, foffset, div);
200 return zl10036_write(state, buf, sizeof(buf));
203 static int zl10036_set_bandwidth(struct zl10036_state *state, u32 fbw)
255 if (br != state->br) {
256 ret = zl10036_write(state, buf_br, sizeof(buf_br));
261 if (bf != state->bf) {
262 ret = zl10036_write(state, buf_bf, sizeof(buf_bf));
271 ret = zl10036_write(state, zl10036_rsd_off,
277 state->br = br;
278 state->bf = bf;
283 static int zl10036_set_gain_params(struct zl10036_state *state,
298 if (!state->config->rf_loop_enable)
305 return zl10036_write(state, buf, sizeof(buf));
311 struct zl10036_state *state = fe->tuner_priv;
352 ret = zl10036_set_gain_params(state, c);
356 ret = zl10036_set_frequency(state, params->frequency);
360 ret = zl10036_set_bandwidth(state, fbw);
366 ret = zl10036_read_status_reg(state);
386 struct zl10036_state *state = fe->tuner_priv;
388 *frequency = state->frequency;
393 static int zl10036_init_regs(struct zl10036_state *state)
411 state->br = 0xff;
412 state->bf = 0xff;
414 if (!state->config->rf_loop_enable)
420 ret = zl10036_write(state, zl10036_init_tab[i], 2);
430 struct zl10036_state *state = fe->tuner_priv;
436 ret = zl10036_read_status_reg(state);
441 ret = zl10036_init_regs(state);
466 struct zl10036_state *state = NULL;
474 state = kzalloc(sizeof(struct zl10036_state), GFP_KERNEL);
475 if (NULL == state)
478 state->config = config;
479 state->i2c = i2c;
484 ret = zl10036_read_status_reg(state);
490 ret = zl10036_init_regs(state);
500 fe->tuner_priv = state;