Lines Matching +full:- +full:35000
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Driver for Zarlink zl10036 DVB-S silicon tuner
6 * Copyright (C) 2007-2009 Matthias Schwarzott <zzam@gentoo.de>
10 * http://www.mcmilk.de/projects/dvb-card/datasheets/ZL10036.pdf
12 * This one is working: (at my Avermedia DVB-S Pro)
13 * - zl10036 (40pin, FTA)
63 { .addr = state->config->tuner_address, .flags = I2C_M_RD, in zl10036_read_status_reg()
67 if (i2c_transfer(state->i2c, msg, 1) != 1) { in zl10036_read_status_reg()
69 __func__, state->config->tuner_address); in zl10036_read_status_reg()
70 return -EIO; in zl10036_read_status_reg()
76 deb_info("%s: Power-On-Reset bit enabled - need to initialize the tuner\n", in zl10036_read_status_reg()
85 { .addr = state->config->tuner_address, .flags = 0, in zl10036_write()
92 /* every 8bit-value satisifes this! in zl10036_write()
116 ret = i2c_transfer(state->i2c, msg, 1); in zl10036_write()
119 return -EIO; in zl10036_write()
127 struct zl10036_state *state = fe->tuner_priv; in zl10036_release()
129 fe->tuner_priv = NULL; in zl10036_release()
135 struct zl10036_state *state = fe->tuner_priv; in zl10036_sleep()
141 if (fe->ops.i2c_gate_ctrl) in zl10036_sleep()
142 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ in zl10036_sleep()
146 if (fe->ops.i2c_gate_ctrl) in zl10036_sleep()
147 fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ in zl10036_sleep()
176 state->frequency = div * _FR; in zl10036_set_frequency()
178 foffset = frequency - state->frequency; in zl10036_set_frequency()
184 frequency, state->frequency, foffset, div); in zl10036_set_frequency()
203 if (fbw > 35000) in zl10036_set_bandwidth()
204 fbw = 35000; in zl10036_set_bandwidth()
229 * bf = fbw/_XTAL * br * k - 1 */ in zl10036_set_bandwidth()
231 bf = (fbw * br * 1257) / (_XTAL * 1000) - 1; in zl10036_set_bandwidth()
241 if (br != state->br) { in zl10036_set_bandwidth()
247 if (bf != state->bf) { in zl10036_set_bandwidth()
254 * maximum br is 63 -> max time = 2 /10 MHz = 2e-7 */ in zl10036_set_bandwidth()
263 state->br = br; in zl10036_set_bandwidth()
264 state->bf = bf; in zl10036_set_bandwidth()
284 if (!state->config->rf_loop_enable) in zl10036_set_gain_params()
296 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in zl10036_set_params()
297 struct zl10036_state *state = fe->tuner_priv; in zl10036_set_params()
299 u32 frequency = p->frequency; in zl10036_set_params()
306 if ((frequency < fe->ops.info.frequency_min_hz / kHz) in zl10036_set_params()
307 || (frequency > fe->ops.info.frequency_max_hz / kHz)) in zl10036_set_params()
308 return -EINVAL; in zl10036_set_params()
311 * alpha = 1.35 for dvb-s in zl10036_set_params()
315 fbw = (27 * p->symbol_rate) / 32; in zl10036_set_params()
323 /* setting the charge pump - guessed values */ in zl10036_set_params()
325 return -EINVAL; in zl10036_set_params()
333 return -EINVAL; in zl10036_set_params()
335 if (fe->ops.i2c_gate_ctrl) in zl10036_set_params()
336 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ in zl10036_set_params()
342 ret = zl10036_set_frequency(state, p->frequency); in zl10036_set_params()
350 /* wait for tuner lock - no idea if this is really needed */ in zl10036_set_params()
364 if (fe->ops.i2c_gate_ctrl) in zl10036_set_params()
365 fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ in zl10036_set_params()
372 struct zl10036_state *state = fe->tuner_priv; in zl10036_get_frequency()
374 *frequency = state->frequency; in zl10036_get_frequency()
386 { 0x04, 0x00 }, /* 2/3: div=0x400 - arbitrary value */ in zl10036_init_regs()
397 state->br = 0xff; in zl10036_init_regs()
398 state->bf = 0xff; in zl10036_init_regs()
400 if (!state->config->rf_loop_enable) in zl10036_init_regs()
416 struct zl10036_state *state = fe->tuner_priv; in zl10036_init()
419 if (fe->ops.i2c_gate_ctrl) in zl10036_init()
420 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ in zl10036_init()
426 /* Only init if Power-on-Reset bit is set? */ in zl10036_init()
429 if (fe->ops.i2c_gate_ctrl) in zl10036_init()
430 fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ in zl10036_init()
464 state->config = config; in zl10036_attach()
465 state->i2c = i2c; in zl10036_attach()
467 if (fe->ops.i2c_gate_ctrl) in zl10036_attach()
468 fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ in zl10036_attach()
483 if (fe->ops.i2c_gate_ctrl) in zl10036_attach()
484 fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ in zl10036_attach()
486 fe->tuner_priv = state; in zl10036_attach()
488 memcpy(&fe->ops.tuner_ops, &zl10036_tuner_ops, in zl10036_attach()
491 __func__, fe->ops.tuner_ops.info.name, config->tuner_address); in zl10036_attach()