Lines Matching +full:adc +full:- +full:freq

1 // SPDX-License-Identifier: GPL-2.0
16 #include "tuner-i2c.h"
40 /* Bits 0-5 for divider MSB */
43 /* Bits 0-7 for divider LSB */
50 /* Searches with ADC output = 10 */
53 /* Searches with ADC output = 10 */
56 /* Searches with ADC output = 5 */
59 /* if on, div=4*(Frf+Fif)/Fref otherwise, div=4*(Frf-Fif)/Freq) */
78 /* Japan freq (76-108 MHz. If disabled, 87.5-108 MHz */
81 /* Unselected means 32.768 KHz freq as reference. Otherwise Xtal at 13 MHz */
111 /* Bits 0-5 for divider MSB after search or preset */
114 /* Bits 0-7 for divider LSB after search or preset */
149 switch (priv->ctrl.xtal_freq) { in tea5767_status_dump()
151 frq = (div * 50000 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
154 frq = (div * 50000 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
157 frq = (div * 32768 + 700000 + 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
161 frq = (div * 32768 - 700000 - 225000) / 4; /* Freq in KHz */ in tea5767_status_dump()
177 tuner_info("ADC Level = %d\n", in tea5767_status_dump()
186 /* Freq should be specifyed at 62.5 Hz */
190 struct tea5767_priv *priv = fe->tuner_priv; in set_radio_freq()
191 unsigned int frq = params->frequency; in set_radio_freq()
196 tuner_dbg("radio freq = %d.%03d MHz\n", frq/16000,(frq/16)%1000); in set_radio_freq()
200 if (priv->ctrl.port1) in set_radio_freq()
203 if (params->audmode == V4L2_TUNER_MODE_MONO) { in set_radio_freq()
213 if (priv->ctrl.port2) in set_radio_freq()
216 if (priv->ctrl.high_cut) in set_radio_freq()
219 if (priv->ctrl.st_noise) in set_radio_freq()
222 if (priv->ctrl.soft_mute) in set_radio_freq()
225 if (priv->ctrl.japan_band) in set_radio_freq()
230 if (priv->ctrl.deemph_75) in set_radio_freq()
233 if (priv->ctrl.pllref) in set_radio_freq()
237 /* Rounds freq to next decimal value - for 62.5 KHz step */ in set_radio_freq()
240 switch (priv->ctrl.xtal_freq) { in set_radio_freq()
249 div = (frq * (4000 / 16) - 700000 - 225000 + 25000) / 50000; in set_radio_freq()
254 /* const 700=4000*175 Khz - to adjust freq to right value */ in set_radio_freq()
255 div = ((frq * (4000 / 16) - 700000 - 225000) + 16384) >> 15; in set_radio_freq()
269 if (5 != (rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, 5))) in set_radio_freq()
273 if (5 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props, buffer, 5))) in set_radio_freq()
279 priv->frequency = frq * 125 / 2; in set_radio_freq()
286 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_read_status()
290 if (5 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props, buffer, 5))) { in tea5767_read_status()
292 return -EREMOTEIO; in tea5767_read_status()
300 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_signal()
311 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_stereo()
351 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_standby()
362 if (5 != (rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, 5))) in tea5767_standby()
377 return -EINVAL; in tea5767_autodetection()
384 return -EINVAL; in tea5767_autodetection()
394 return -EINVAL; in tea5767_autodetection()
403 kfree(fe->tuner_priv); in tea5767_release()
404 fe->tuner_priv = NULL; in tea5767_release()
409 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_get_frequency()
410 *frequency = priv->frequency; in tea5767_get_frequency()
417 struct tea5767_priv *priv = fe->tuner_priv; in tea5767_set_config()
419 memcpy(&priv->ctrl, priv_cfg, sizeof(priv->ctrl)); in tea5767_set_config()
447 fe->tuner_priv = priv; in tea5767_attach()
449 priv->i2c_props.addr = i2c_addr; in tea5767_attach()
450 priv->i2c_props.adap = i2c_adap; in tea5767_attach()
451 priv->i2c_props.name = "tea5767"; in tea5767_attach()
453 priv->ctrl.xtal_freq = TEA5767_HIGH_LO_32768; in tea5767_attach()
454 priv->ctrl.port1 = 1; in tea5767_attach()
455 priv->ctrl.port2 = 1; in tea5767_attach()
456 priv->ctrl.high_cut = 1; in tea5767_attach()
457 priv->ctrl.st_noise = 1; in tea5767_attach()
458 priv->ctrl.japan_band = 1; in tea5767_attach()
460 memcpy(&fe->ops.tuner_ops, &tea5767_tuner_ops, in tea5767_attach()