Lines Matching refs:state

34 static int mxl111sf_tuner_read_reg(struct mxl111sf_tuner_state *state,
37 return (state->cfg->read_reg) ?
38 state->cfg->read_reg(state->mxl_state, addr, data) :
42 static int mxl111sf_tuner_write_reg(struct mxl111sf_tuner_state *state,
45 return (state->cfg->write_reg) ?
46 state->cfg->write_reg(state->mxl_state, addr, data) :
50 static int mxl111sf_tuner_program_regs(struct mxl111sf_tuner_state *state,
53 return (state->cfg->program_regs) ?
54 state->cfg->program_regs(state->mxl_state, ctrl_reg_info) :
58 static int mxl1x1sf_tuner_top_master_ctrl(struct mxl111sf_tuner_state *state,
61 return (state->cfg->top_master_ctrl) ?
62 state->cfg->top_master_ctrl(state->mxl_state, onoff) :
124 static int mxl1x1sf_tuner_set_if_output_freq(struct mxl111sf_tuner_state *state)
133 state->cfg->invert_spectrum, state->cfg->if_freq);
136 ctrl = state->cfg->invert_spectrum;
138 ctrl |= state->cfg->if_freq;
140 ret = mxl111sf_tuner_write_reg(state, V6_TUNER_IF_SEL_REG, ctrl);
150 if (MXL_IF_LO == state->cfg->if_freq) {
153 } else if (MXL_IF_HI == state->cfg->if_freq) {
163 ret = mxl111sf_tuner_read_reg(state, V6_TUNER_IF_FCW_BYP_REG, &ctrl);
170 ret = mxl111sf_tuner_write_reg(state, V6_TUNER_IF_FCW_BYP_REG, ctrl);
177 ret = mxl111sf_tuner_write_reg(state, V6_TUNER_IF_FCW_REG, ctrl);
181 state->if_freq = state->cfg->if_freq;
188 struct mxl111sf_tuner_state *state = fe->tuner_priv;
196 ret = mxl111sf_tuner_write_reg(state, START_TUNE_REG, 0);
201 ret = mxl111sf_tuner_read_reg(state, MXL_MODE_REG, &mxl_mode);
210 ret = mxl111sf_tuner_program_regs(state, reg_ctrl_array);
216 mxl1x1sf_tuner_top_master_ctrl(state, 0);
217 mxl1x1sf_tuner_top_master_ctrl(state, 1);
218 mxl1x1sf_tuner_set_if_output_freq(state);
221 ret = mxl111sf_tuner_write_reg(state, START_TUNE_REG, 1);
225 if (state->cfg->ant_hunt)
226 state->cfg->ant_hunt(fe);
231 static int mxl1x1sf_tuner_get_lock_status(struct mxl111sf_tuner_state *state,
241 ret = mxl111sf_tuner_read_reg(state, V6_RF_LOCK_STATUS_REG, &data);
252 static int mxl1x1sf_tuner_loop_thru_ctrl(struct mxl111sf_tuner_state *state,
255 return mxl111sf_tuner_write_reg(state, V6_TUNER_LOOP_THRU_CTRL_REG,
266 struct mxl111sf_tuner_state *state = fe->tuner_priv;
304 state->frequency = c->frequency;
305 state->bandwidth = c->bandwidth_hz;
315 struct mxl111sf_tuner_state *state = fe->tuner_priv;
325 struct mxl111sf_tuner_state *state = fe->tuner_priv;
338 struct mxl111sf_tuner_state *state = fe->tuner_priv;
343 ret = mxl1x1sf_tuner_get_lock_status(state, &rf_locked, &ref_locked);
357 struct mxl111sf_tuner_state *state = fe->tuner_priv;
363 ret = mxl111sf_tuner_write_reg(state, 0x00, 0x02);
366 ret = mxl111sf_tuner_read_reg(state, V6_DIG_RF_PWR_LSB_REG, &val1);
369 ret = mxl111sf_tuner_read_reg(state, V6_DIG_RF_PWR_MSB_REG, &val2);
375 ret = mxl111sf_tuner_write_reg(state, 0x00, 0x00);
385 struct mxl111sf_tuner_state *state = fe->tuner_priv;
386 *frequency = state->frequency;
392 struct mxl111sf_tuner_state *state = fe->tuner_priv;
393 *bandwidth = state->bandwidth;
400 struct mxl111sf_tuner_state *state = fe->tuner_priv;
404 switch (state->if_freq) {
447 struct mxl111sf_tuner_state *state = fe->tuner_priv;
449 kfree(state);
481 struct mxl111sf_tuner_state *state = NULL;
485 state = kzalloc(sizeof(struct mxl111sf_tuner_state), GFP_KERNEL);
486 if (state == NULL)
489 state->mxl_state = mxl_state;
490 state->cfg = cfg;
495 fe->tuner_priv = state;