Lines Matching +full:1000 +full:- +full:10000

1 // SPDX-License-Identifier: GPL-2.0-or-later
45 msg.addr = state->config->demod_address; in tda10086_write_byte()
46 ret = i2c_transfer(state->i2c, &msg, 1); in tda10086_write_byte()
63 msg[0].addr = state->config->demod_address; in tda10086_read_byte()
64 msg[1].addr = state->config->demod_address; in tda10086_read_byte()
65 ret = i2c_transfer(state->i2c, msg, 2); in tda10086_read_byte()
95 struct tda10086_state* state = fe->demodulator_priv; in tda10086_init()
100 if (state->config->diseqc_tone) in tda10086_init()
120 if (state->config->xtal_freq == TDA10086_XTAL_16M) { in tda10086_init()
133 tda10086_write_byte(state, 0x56, 0x80); /* powerdown WPLL - unused in the mode we use */ in tda10086_init()
134 tda10086_write_byte(state, 0x57, 0x08); /* bypass WPLL - unused in the mode we use */ in tda10086_init()
157 tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); in tda10086_init()
158 tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); in tda10086_init()
178 struct tda10086_state* state = fe->demodulator_priv; in tda10086_set_tone()
183 if (state->config->diseqc_tone) in tda10086_set_tone()
202 struct tda10086_state* state = fe->demodulator_priv; in tda10086_send_master_cmd()
209 if (state->config->diseqc_tone) in tda10086_send_master_cmd()
212 if (cmd->msg_len > 6) in tda10086_send_master_cmd()
213 return -EINVAL; in tda10086_send_master_cmd()
216 for(i=0; i< cmd->msg_len; i++) { in tda10086_send_master_cmd()
217 tda10086_write_byte(state, 0x48+i, cmd->msg[i]); in tda10086_send_master_cmd()
220 | ((cmd->msg_len - 1) << 4)); in tda10086_send_master_cmd()
232 struct tda10086_state* state = fe->demodulator_priv; in tda10086_send_burst()
238 if (state->config->diseqc_tone) in tda10086_send_burst()
263 dprintk ("%s %i %i\n", __func__, fe_params->inversion, state->config->invert); in tda10086_set_inversion()
265 switch(fe_params->inversion) { in tda10086_set_inversion()
267 if (state->config->invert) in tda10086_set_inversion()
271 if (!state->config->invert) in tda10086_set_inversion()
295 u32 symbol_rate = fe_params->symbol_rate; in tda10086_set_symbol_rate()
299 /* setup the decimation and anti-aliasing filters.. */ in tda10086_set_symbol_rate()
300 if (symbol_rate < SACLK / 10000 * 137) { in tda10086_set_symbol_rate()
303 } else if (symbol_rate < SACLK / 10000 * 208) { in tda10086_set_symbol_rate()
306 } else if (symbol_rate < SACLK / 10000 * 270) { in tda10086_set_symbol_rate()
309 } else if (symbol_rate < SACLK / 10000 * 416) { in tda10086_set_symbol_rate()
312 } else if (symbol_rate < SACLK / 10000 * 550) { in tda10086_set_symbol_rate()
315 } else if (symbol_rate < SACLK / 10000 * 833) { in tda10086_set_symbol_rate()
318 } else if (symbol_rate < SACLK / 10000 * 1100) { in tda10086_set_symbol_rate()
321 } else if (symbol_rate < SACLK / 10000 * 1666) { in tda10086_set_symbol_rate()
324 } else if (symbol_rate < SACLK / 10000 * 2200) { in tda10086_set_symbol_rate()
327 } else if (symbol_rate < SACLK / 10000 * 3333) { in tda10086_set_symbol_rate()
337 big = (1ULL<<21) * ((u64) symbol_rate/1000ULL) * (1ULL<<dfn); in tda10086_set_symbol_rate()
338 big += ((SACLK/1000ULL)-1ULL); in tda10086_set_symbol_rate()
339 do_div(big, (SACLK/1000ULL)); in tda10086_set_symbol_rate()
343 tmp = (1<<dfn)*(symbol_rate/1000); in tda10086_set_symbol_rate()
344 bdri = ((32 * (SACLK/1000)) + (tmp-1)) / tmp; in tda10086_set_symbol_rate()
363 dprintk("%s %i\n", __func__, fe_params->fec_inner); in tda10086_set_fec()
365 switch (fe_params->fec_inner) { in tda10086_set_fec()
394 return -1; in tda10086_set_fec()
403 struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache; in tda10086_set_frontend()
404 struct tda10086_state *state = fe->demodulator_priv; in tda10086_set_frontend()
413 state->has_lock = false; in tda10086_set_frontend()
416 if (fe->ops.tuner_ops.set_params) { in tda10086_set_frontend()
417 fe->ops.tuner_ops.set_params(fe); in tda10086_set_frontend()
418 if (fe->ops.i2c_gate_ctrl) in tda10086_set_frontend()
419 fe->ops.i2c_gate_ctrl(fe, 0); in tda10086_set_frontend()
421 if (fe->ops.tuner_ops.get_frequency) in tda10086_set_frontend()
422 fe->ops.tuner_ops.get_frequency(fe, &freq); in tda10086_set_frontend()
423 if (fe->ops.i2c_gate_ctrl) in tda10086_set_frontend()
424 fe->ops.i2c_gate_ctrl(fe, 0); in tda10086_set_frontend()
428 freqoff = fe_params->frequency - freq; in tda10086_set_frontend()
429 freqoff = ((1<<16) * freqoff) / (SACLK/1000); in tda10086_set_frontend()
444 state->symbol_rate = fe_params->symbol_rate; in tda10086_set_frontend()
445 state->frequency = fe_params->frequency; in tda10086_set_frontend()
452 struct tda10086_state* state = fe->demodulator_priv; in tda10086_get_frontend()
460 if (fe_params->symbol_rate < 500000) in tda10086_get_frontend()
461 return -EINVAL; in tda10086_get_frontend()
463 /* calculate the updated frequency (note: we convert from Hz->kHz) */ in tda10086_get_frontend()
468 tmp64 = (tmp64 * (SACLK/1000ULL)); in tda10086_get_frontend()
470 fe_params->frequency = (int) state->frequency + (int) tmp64; in tda10086_get_frontend()
477 fe_params->inversion = INVERSION_OFF; in tda10086_get_frontend()
478 if (state->config->invert) in tda10086_get_frontend()
479 fe_params->inversion = INVERSION_ON; in tda10086_get_frontend()
482 fe_params->inversion = INVERSION_ON; in tda10086_get_frontend()
483 if (state->config->invert) in tda10086_get_frontend()
484 fe_params->inversion = INVERSION_OFF; in tda10086_get_frontend()
491 fe_params->inversion = INVERSION_OFF; in tda10086_get_frontend()
492 if (state->config->invert) in tda10086_get_frontend()
493 fe_params->inversion = INVERSION_ON; in tda10086_get_frontend()
496 fe_params->inversion = INVERSION_ON; in tda10086_get_frontend()
497 if (state->config->invert) in tda10086_get_frontend()
498 fe_params->inversion = INVERSION_OFF; in tda10086_get_frontend()
508 tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000); in tda10086_get_frontend()
509 fe_params->symbol_rate = state->symbol_rate + tmp; in tda10086_get_frontend()
515 fe_params->fec_inner = FEC_1_2; in tda10086_get_frontend()
518 fe_params->fec_inner = FEC_2_3; in tda10086_get_frontend()
521 fe_params->fec_inner = FEC_3_4; in tda10086_get_frontend()
524 fe_params->fec_inner = FEC_4_5; in tda10086_get_frontend()
527 fe_params->fec_inner = FEC_5_6; in tda10086_get_frontend()
530 fe_params->fec_inner = FEC_6_7; in tda10086_get_frontend()
533 fe_params->fec_inner = FEC_7_8; in tda10086_get_frontend()
536 fe_params->fec_inner = FEC_8_9; in tda10086_get_frontend()
546 struct tda10086_state* state = fe->demodulator_priv; in tda10086_read_status()
563 if (!state->has_lock) { in tda10086_read_status()
564 state->has_lock = true; in tda10086_read_status()
575 struct tda10086_state* state = fe->demodulator_priv; in tda10086_read_signal_strength()
580 _str = 0xff - tda10086_read_byte(state, 0x43); in tda10086_read_signal_strength()
588 struct tda10086_state* state = fe->demodulator_priv; in tda10086_read_snr()
593 _snr = 0xff - tda10086_read_byte(state, 0x1c); in tda10086_read_snr()
601 struct tda10086_state* state = fe->demodulator_priv; in tda10086_read_ucblocks()
617 struct tda10086_state* state = fe->demodulator_priv; in tda10086_read_ber()
632 struct tda10086_state* state = fe->demodulator_priv; in tda10086_sleep()
643 struct tda10086_state* state = fe->demodulator_priv; in tda10086_i2c_gate_ctrl()
658 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in tda10086_get_tune_settings()
660 if (p->symbol_rate > 20000000) { in tda10086_get_tune_settings()
661 fesettings->min_delay_ms = 50; in tda10086_get_tune_settings()
662 fesettings->step_size = 2000; in tda10086_get_tune_settings()
663 fesettings->max_drift = 8000; in tda10086_get_tune_settings()
664 } else if (p->symbol_rate > 12000000) { in tda10086_get_tune_settings()
665 fesettings->min_delay_ms = 100; in tda10086_get_tune_settings()
666 fesettings->step_size = 1500; in tda10086_get_tune_settings()
667 fesettings->max_drift = 9000; in tda10086_get_tune_settings()
668 } else if (p->symbol_rate > 8000000) { in tda10086_get_tune_settings()
669 fesettings->min_delay_ms = 100; in tda10086_get_tune_settings()
670 fesettings->step_size = 1000; in tda10086_get_tune_settings()
671 fesettings->max_drift = 8000; in tda10086_get_tune_settings()
672 } else if (p->symbol_rate > 4000000) { in tda10086_get_tune_settings()
673 fesettings->min_delay_ms = 100; in tda10086_get_tune_settings()
674 fesettings->step_size = 500; in tda10086_get_tune_settings()
675 fesettings->max_drift = 7000; in tda10086_get_tune_settings()
676 } else if (p->symbol_rate > 2000000) { in tda10086_get_tune_settings()
677 fesettings->min_delay_ms = 200; in tda10086_get_tune_settings()
678 fesettings->step_size = p->symbol_rate / 8000; in tda10086_get_tune_settings()
679 fesettings->max_drift = 14 * fesettings->step_size; in tda10086_get_tune_settings()
681 fesettings->min_delay_ms = 200; in tda10086_get_tune_settings()
682 fesettings->step_size = p->symbol_rate / 8000; in tda10086_get_tune_settings()
683 fesettings->max_drift = 18 * fesettings->step_size; in tda10086_get_tune_settings()
691 struct tda10086_state *state = fe->demodulator_priv; in tda10086_release()
699 .name = "Philips TDA10086 DVB-S",
745 state->config = config; in tda10086_attach()
746 state->i2c = i2c; in tda10086_attach()
755 memcpy(&state->frontend.ops, &tda10086_ops, sizeof(struct dvb_frontend_ops)); in tda10086_attach()
756 state->frontend.demodulator_priv = state; in tda10086_attach()
757 return &state->frontend; in tda10086_attach()
763 MODULE_DESCRIPTION("Philips TDA10086 DVB-S Demodulator");