Lines Matching +full:phase +full:- +full:locked

1 // SPDX-License-Identifier: GPL-2.0-or-later
27 const struct tda665x_config *config = state->config; in tda665x_read()
29 struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD, .buf = buf, .len = 2 }; in tda665x_read()
31 err = i2c_transfer(state->i2c, &msg, 1); in tda665x_read()
43 const struct tda665x_config *config = state->config; in tda665x_write()
45 struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = length }; in tda665x_write()
47 err = i2c_transfer(state->i2c, &msg, 1); in tda665x_write()
59 struct tda665x_state *state = fe->tuner_priv; in tda665x_get_frequency()
61 *frequency = state->frequency; in tda665x_get_frequency()
68 struct tda665x_state *state = fe->tuner_priv; in tda665x_get_status()
79 printk(KERN_DEBUG "%s: Tuner Phase Locked\n", __func__); in tda665x_get_status()
92 struct tda665x_state *state = fe->tuner_priv; in tda665x_set_frequency()
93 const struct tda665x_config *config = state->config; in tda665x_set_frequency()
98 if ((new_frequency < config->frequency_max) in tda665x_set_frequency()
99 || (new_frequency > config->frequency_min)) { in tda665x_set_frequency()
102 return -EINVAL; in tda665x_set_frequency()
107 frequency += config->frequency_offst; in tda665x_set_frequency()
108 frequency *= config->ref_multiplier; in tda665x_set_frequency()
109 frequency += config->ref_divider >> 1; in tda665x_set_frequency()
110 frequency /= config->ref_divider; in tda665x_set_frequency()
121 /* VHF-L */ in tda665x_set_frequency()
122 buf[3] |= 0x01; /* fc, Low Band, 47 - 153 MHz */ in tda665x_set_frequency()
132 /* VHF-H */ in tda665x_set_frequency()
133 buf[3] |= 0x02; /* fc, Mid Band, 153 - 438 MHz */ in tda665x_set_frequency()
142 buf[3] |= 0x04; /* fc, High Band, 438 - 862 MHz */ in tda665x_set_frequency()
157 printk(KERN_DEBUG "%s: Waiting to Phase LOCK\n", __func__); in tda665x_set_frequency()
165 printk(KERN_DEBUG "%s: Tuner Phase locked: status=%d\n", in tda665x_set_frequency()
167 state->frequency = frequency; /* cache successful state */ in tda665x_set_frequency()
169 printk(KERN_ERR "%s: No Phase lock: status=%d\n", in tda665x_set_frequency()
181 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in tda665x_set_params()
183 tda665x_set_frequency(fe, c->frequency); in tda665x_set_params()
190 struct tda665x_state *state = fe->tuner_priv; in tda665x_release()
192 fe->tuner_priv = NULL; in tda665x_release()
214 state->config = config; in tda665x_attach()
215 state->i2c = i2c; in tda665x_attach()
216 state->fe = fe; in tda665x_attach()
217 fe->tuner_priv = state; in tda665x_attach()
218 fe->ops.tuner_ops = tda665x_ops; in tda665x_attach()
219 info = &fe->ops.tuner_ops.info; in tda665x_attach()
221 memcpy(info->name, config->name, sizeof(config->name)); in tda665x_attach()
222 info->frequency_min_hz = config->frequency_min; in tda665x_attach()
223 info->frequency_max_hz = config->frequency_max; in tda665x_attach()
224 info->frequency_step_hz = config->frequency_offst; in tda665x_attach()
226 printk(KERN_DEBUG "%s: Attaching TDA665x (%s) tuner\n", __func__, info->name); in tda665x_attach()