Lines Matching +full:de +full:- +full:activated
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for Zarlink DVB-T MT352 demodulator
5 * Written by Holger Waechtler <holger@qanu.de>
6 * and Daniel Mack <daniel@qanu.de>
8 * AVerMedia AVerTV DVB-T 771 support by
9 * Wolfram Joost <dbox2@frokaschwei.de>
15 * DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by
46 struct mt352_state* state = fe->demodulator_priv; in mt352_single_write()
48 struct i2c_msg msg = { .addr = state->config.demod_address, .flags = 0, in mt352_single_write()
50 int err = i2c_transfer(state->i2c, &msg, 1); in mt352_single_write()
61 for (i=0; i < ilen-1; i++) in _mt352_write()
73 struct i2c_msg msg [] = { { .addr = state->config.demod_address, in mt352_read_register()
76 { .addr = state->config.demod_address, in mt352_read_register()
80 ret = i2c_transfer(state->i2c, msg, 2); in mt352_read_register()
118 if (state->config.adc_clock) in mt352_calc_nominal_rate()
119 adc_clock = state->config.adc_clock; in mt352_calc_nominal_rate()
136 if (state->config.adc_clock) in mt352_calc_input_freq()
137 adc_clock = state->config.adc_clock; in mt352_calc_input_freq()
138 if (state->config.if2) in mt352_calc_input_freq()
139 if2 = state->config.if2; in mt352_calc_input_freq()
144 ife = adc_clock - (if2 % adc_clock); in mt352_calc_input_freq()
146 ife = adc_clock - ife; in mt352_calc_input_freq()
148 value = -16374 * ife / adc_clock; in mt352_calc_input_freq()
157 struct dtv_frontend_properties *op = &fe->dtv_property_cache; in mt352_set_parameters()
158 struct mt352_state* state = fe->demodulator_priv; in mt352_set_parameters()
164 switch (op->code_rate_HP) { in mt352_set_parameters()
181 return -EINVAL; in mt352_set_parameters()
184 switch (op->code_rate_LP) { in mt352_set_parameters()
201 if (op->hierarchy == HIERARCHY_AUTO || in mt352_set_parameters()
202 op->hierarchy == HIERARCHY_NONE) in mt352_set_parameters()
206 return -EINVAL; in mt352_set_parameters()
209 switch (op->modulation) { in mt352_set_parameters()
220 return -EINVAL; in mt352_set_parameters()
223 switch (op->transmission_mode) { in mt352_set_parameters()
231 return -EINVAL; in mt352_set_parameters()
234 switch (op->guard_interval) { in mt352_set_parameters()
248 return -EINVAL; in mt352_set_parameters()
251 switch (op->hierarchy) { in mt352_set_parameters()
265 return -EINVAL; in mt352_set_parameters()
277 mt352_calc_nominal_rate(state, op->bandwidth_hz, buf+4); in mt352_set_parameters()
280 if (state->config.no_tuner) { in mt352_set_parameters()
281 if (fe->ops.tuner_ops.set_params) { in mt352_set_parameters()
282 fe->ops.tuner_ops.set_params(fe); in mt352_set_parameters()
283 if (fe->ops.i2c_gate_ctrl) in mt352_set_parameters()
284 fe->ops.i2c_gate_ctrl(fe, 0); in mt352_set_parameters()
290 if (fe->ops.tuner_ops.calc_regs) { in mt352_set_parameters()
291 fe->ops.tuner_ops.calc_regs(fe, buf+8, 5); in mt352_set_parameters()
304 struct mt352_state* state = fe->demodulator_priv; in mt352_get_parameters()
321 return -EINVAL; in mt352_get_parameters()
323 /* Use TPS_RECEIVED-registers, not the TPS_CURRENT-registers because in mt352_get_parameters()
330 op->code_rate_HP = tps_fec_to_api[(tps >> 7) & 7]; in mt352_get_parameters()
331 op->code_rate_LP = tps_fec_to_api[(tps >> 4) & 7]; in mt352_get_parameters()
336 op->modulation = QPSK; in mt352_get_parameters()
339 op->modulation = QAM_16; in mt352_get_parameters()
342 op->modulation = QAM_64; in mt352_get_parameters()
345 op->modulation = QAM_AUTO; in mt352_get_parameters()
349 op->transmission_mode = (tps & 0x01) ? TRANSMISSION_MODE_8K : TRANSMISSION_MODE_2K; in mt352_get_parameters()
354 op->guard_interval = GUARD_INTERVAL_1_32; in mt352_get_parameters()
357 op->guard_interval = GUARD_INTERVAL_1_16; in mt352_get_parameters()
360 op->guard_interval = GUARD_INTERVAL_1_8; in mt352_get_parameters()
363 op->guard_interval = GUARD_INTERVAL_1_4; in mt352_get_parameters()
366 op->guard_interval = GUARD_INTERVAL_AUTO; in mt352_get_parameters()
373 op->hierarchy = HIERARCHY_NONE; in mt352_get_parameters()
376 op->hierarchy = HIERARCHY_1; in mt352_get_parameters()
379 op->hierarchy = HIERARCHY_2; in mt352_get_parameters()
382 op->hierarchy = HIERARCHY_4; in mt352_get_parameters()
385 op->hierarchy = HIERARCHY_AUTO; in mt352_get_parameters()
389 op->frequency = (500 * (div - IF_FREQUENCYx6)) / 3 * 1000; in mt352_get_parameters()
392 op->bandwidth_hz = 8000000; in mt352_get_parameters()
394 op->bandwidth_hz = 7000000; in mt352_get_parameters()
396 op->bandwidth_hz = 6000000; in mt352_get_parameters()
400 op->inversion = INVERSION_OFF; in mt352_get_parameters()
402 op->inversion = INVERSION_ON; in mt352_get_parameters()
409 struct mt352_state* state = fe->demodulator_priv; in mt352_read_status()
414 * The MT352 design manual from Zarlink states (page 46-47): in mt352_read_status()
418 * If the Read_Tuner_Byte (bit-1) is activated, then the tuner status in mt352_read_status()
420 * completion of the read operation is indicated by bit-5 of the in mt352_read_status()
425 return -EREMOTEIO; in mt352_read_status()
427 return -EREMOTEIO; in mt352_read_status()
429 return -EREMOTEIO; in mt352_read_status()
452 struct mt352_state* state = fe->demodulator_priv; in mt352_read_ber()
463 struct mt352_state* state = fe->demodulator_priv; in mt352_read_signal_strength()
476 struct mt352_state* state = fe->demodulator_priv; in mt352_read_snr()
486 struct mt352_state* state = fe->demodulator_priv; in mt352_read_ucblocks()
496 fe_tune_settings->min_delay_ms = 800; in mt352_get_tune_settings()
497 fe_tune_settings->step_size = 0; in mt352_get_tune_settings()
498 fe_tune_settings->max_drift = 0; in mt352_get_tune_settings()
505 struct mt352_state* state = fe->demodulator_priv; in mt352_init()
516 return state->config.demod_init(fe); in mt352_init()
524 struct mt352_state* state = fe->demodulator_priv; in mt352_release()
540 state->i2c = i2c; in mt352_attach()
541 memcpy(&state->config,config,sizeof(struct mt352_config)); in mt352_attach()
547 memcpy(&state->frontend.ops, &mt352_ops, sizeof(struct dvb_frontend_ops)); in mt352_attach()
548 state->frontend.demodulator_priv = state; in mt352_attach()
549 return &state->frontend; in mt352_attach()
559 .name = "Zarlink MT352 DVB-T",
592 MODULE_DESCRIPTION("Zarlink MT352 DVB-T Demodulator driver");