Lines Matching +full:switch +full:- +full:mode +full:- +full:frequency
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * mxl111sf-tuner.c - driver for the MaxLinear MXL111SF CMOS tuner
5 * Copyright (C) 2010-2014 Michael Krufky <mkrufky@linuxtv.org>
8 #include "mxl111sf-tuner.h"
9 #include "mxl111sf-phy.h"
10 #include "mxl111sf-reg.h"
15 MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able)).");
21 /* ------------------------------------------------------------------------ */
30 u32 frequency; member
37 return (state->cfg->read_reg) ? in mxl111sf_tuner_read_reg()
38 state->cfg->read_reg(state->mxl_state, addr, data) : in mxl111sf_tuner_read_reg()
39 -EINVAL; in mxl111sf_tuner_read_reg()
45 return (state->cfg->write_reg) ? in mxl111sf_tuner_write_reg()
46 state->cfg->write_reg(state->mxl_state, addr, data) : in mxl111sf_tuner_write_reg()
47 -EINVAL; in mxl111sf_tuner_write_reg()
53 return (state->cfg->program_regs) ? in mxl111sf_tuner_program_regs()
54 state->cfg->program_regs(state->mxl_state, ctrl_reg_info) : in mxl111sf_tuner_program_regs()
55 -EINVAL; in mxl111sf_tuner_program_regs()
61 return (state->cfg->top_master_ctrl) ? in mxl1x1sf_tuner_top_master_ctrl()
62 state->cfg->top_master_ctrl(state->mxl_state, onoff) : in mxl1x1sf_tuner_top_master_ctrl()
63 -EINVAL; in mxl1x1sf_tuner_top_master_ctrl()
66 /* ------------------------------------------------------------------------ */
71 {0x1e, 0xff, 0x00}, /* channel frequency (lo and fractional) */
72 {0x1f, 0xff, 0x00}, /* channel frequency (hi for integer portion) */
76 /* ------------------------------------------------------------------------ */
84 switch (bw) { in mxl111sf_calc_phy_tune_regs()
133 state->cfg->invert_spectrum, state->cfg->if_freq); in mxl1x1sf_tuner_set_if_output_freq()
136 ctrl = state->cfg->invert_spectrum; in mxl1x1sf_tuner_set_if_output_freq()
138 ctrl |= state->cfg->if_freq; in mxl1x1sf_tuner_set_if_output_freq()
150 if (MXL_IF_LO == state->cfg->if_freq) { in mxl1x1sf_tuner_set_if_output_freq()
153 } else if (MXL_IF_HI == state->cfg->if_freq) { in mxl1x1sf_tuner_set_if_output_freq()
181 state->if_freq = state->cfg->if_freq; in mxl1x1sf_tuner_set_if_output_freq()
188 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl1x1sf_tune_rf()
200 /* check device mode */ in mxl1x1sf_tune_rf()
208 return -EINVAL; in mxl1x1sf_tune_rf()
215 /* IF tuner mode only */ in mxl1x1sf_tune_rf()
225 if (state->cfg->ant_hunt) in mxl1x1sf_tune_rf()
226 state->cfg->ant_hunt(fe); in mxl1x1sf_tune_rf()
260 /* ------------------------------------------------------------------------ */
264 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in mxl111sf_tuner_set_params()
265 u32 delsys = c->delivery_system; in mxl111sf_tuner_set_params()
266 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_set_params()
272 switch (delsys) { in mxl111sf_tuner_set_params()
281 switch (c->bandwidth_hz) { in mxl111sf_tuner_set_params()
293 return -EINVAL; in mxl111sf_tuner_set_params()
298 return -EINVAL; in mxl111sf_tuner_set_params()
300 ret = mxl1x1sf_tune_rf(fe, c->frequency, bw); in mxl111sf_tuner_set_params()
304 state->frequency = c->frequency; in mxl111sf_tuner_set_params()
305 state->bandwidth = c->bandwidth_hz; in mxl111sf_tuner_set_params()
310 /* ------------------------------------------------------------------------ */
315 struct mxl111sf_tuner_state *state = fe->tuner_priv;
325 struct mxl111sf_tuner_state *state = fe->tuner_priv;
328 /* enter standby mode handled by usb driver */
334 /* ------------------------------------------------------------------------ */
338 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_get_status()
357 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_get_rf_strength()
381 /* ------------------------------------------------------------------------ */
383 static int mxl111sf_tuner_get_frequency(struct dvb_frontend *fe, u32 *frequency) in mxl111sf_tuner_get_frequency() argument
385 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_get_frequency()
386 *frequency = state->frequency; in mxl111sf_tuner_get_frequency()
392 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_get_bandwidth()
393 *bandwidth = state->bandwidth; in mxl111sf_tuner_get_bandwidth()
398 u32 *frequency) in mxl111sf_tuner_get_if_frequency() argument
400 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_get_if_frequency()
402 *frequency = 0; in mxl111sf_tuner_get_if_frequency()
404 switch (state->if_freq) { in mxl111sf_tuner_get_if_frequency()
406 *frequency = 4000000; in mxl111sf_tuner_get_if_frequency()
409 *frequency = 4500000; in mxl111sf_tuner_get_if_frequency()
412 *frequency = 4570000; in mxl111sf_tuner_get_if_frequency()
415 *frequency = 5000000; in mxl111sf_tuner_get_if_frequency()
418 *frequency = 5380000; in mxl111sf_tuner_get_if_frequency()
421 *frequency = 6000000; in mxl111sf_tuner_get_if_frequency()
424 *frequency = 6280000; in mxl111sf_tuner_get_if_frequency()
427 *frequency = 7200000; in mxl111sf_tuner_get_if_frequency()
430 *frequency = 35250000; in mxl111sf_tuner_get_if_frequency()
433 *frequency = 36000000; in mxl111sf_tuner_get_if_frequency()
436 *frequency = 36150000; in mxl111sf_tuner_get_if_frequency()
439 *frequency = 44000000; in mxl111sf_tuner_get_if_frequency()
447 struct mxl111sf_tuner_state *state = fe->tuner_priv; in mxl111sf_tuner_release()
450 fe->tuner_priv = NULL; in mxl111sf_tuner_release()
453 /* ------------------------------------------------------------------------- */
489 state->mxl_state = mxl_state; in mxl111sf_tuner_attach()
490 state->cfg = cfg; in mxl111sf_tuner_attach()
492 memcpy(&fe->ops.tuner_ops, &mxl111sf_tuner_tuner_ops, in mxl111sf_tuner_attach()
495 fe->tuner_priv = state; in mxl111sf_tuner_attach()