Lines Matching +full:decimation +full:- +full:ratio

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 cx24110 - Single Chip Satellite Channel Receiver driver module
5 Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de> based on
74 /* leave front-end AGC parameters at default values */
75 /* leave decimation AGC parameters at default values */
82 {0x41,0x00}, /* @ MSB of front-end derotator frequency */
90 {0x61,0x95}, /* GPIO pins 1-4 have special function */
106 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; in cx24110_writereg()
109 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { in cx24110_writereg()
112 return -EREMOTEIO; in cx24110_writereg()
123 …struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 … in cx24110_readreg()
124 { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; in cx24110_readreg()
126 ret = i2c_transfer(state->i2c, msg, 2); in cx24110_readreg()
146 /* The cx24110 manual tells us this reg is read-only. in cx24110_set_inversion()
162 return -EINVAL; in cx24110_set_inversion()
170 static const int rate[FEC_AUTO] = {-1, 1, 2, 3, 5, 7, -1}; in cx24110_set_fec()
171 static const int g1[FEC_AUTO] = {-1, 0x01, 0x02, 0x05, 0x15, 0x45, -1}; in cx24110_set_fec()
172 static const int g2[FEC_AUTO] = {-1, 0x01, 0x03, 0x06, 0x1a, 0x7a, -1}; in cx24110_set_fec()
175 searches all enabled viterbi rates, and can handle non-standard in cx24110_set_fec()
181 if (fec == FEC_AUTO) { /* (re-)establish AutoAcq behaviour */ in cx24110_set_fec()
198 return -EINVAL; in cx24110_set_fec()
217 return FEC_1_2 + i - 1; in cx24110_get_fec()
230 u32 ratio; in cx24110_set_symbolrate() local
276 ratio=(tmp/BDRI); in cx24110_set_symbolrate()
279 ratio=(ratio<<8)+(tmp/BDRI); in cx24110_set_symbolrate()
282 ratio=(ratio<<8)+(tmp/BDRI); in cx24110_set_symbolrate()
285 ratio=(ratio<<1)+(tmp/BDRI); in cx24110_set_symbolrate()
289 dprintk("ratio= %08x\n", ratio); in cx24110_set_symbolrate()
291 cx24110_writereg(state, 0x1, (ratio>>16)&0xff); in cx24110_set_symbolrate()
292 cx24110_writereg(state, 0x2, (ratio>>8)&0xff); in cx24110_set_symbolrate()
293 cx24110_writereg(state, 0x3, (ratio)&0xff); in cx24110_set_symbolrate()
301 struct cx24110_state *state = fe->demodulator_priv; in _cx24110_pll_write()
304 return -EINVAL; in _cx24110_pll_write()
306 /* tuner data is 21 bits long, must be left-aligned in data */ in _cx24110_pll_write()
343 struct cx24110_state *state = fe->demodulator_priv; in cx24110_initfe()
359 struct cx24110_state *state = fe->demodulator_priv; in cx24110_set_voltage()
367 return -EINVAL; in cx24110_set_voltage()
375 struct cx24110_state *state = fe->demodulator_priv; in cx24110_diseqc_send_burst()
383 return -EINVAL; in cx24110_diseqc_send_burst()
402 struct cx24110_state *state = fe->demodulator_priv; in cx24110_send_diseqc_msg()
405 if (cmd->msg_len < 3 || cmd->msg_len > 6) in cx24110_send_diseqc_msg()
406 return -EINVAL; /* not implemented */ in cx24110_send_diseqc_msg()
408 for (i = 0; i < cmd->msg_len; i++) in cx24110_send_diseqc_msg()
409 cx24110_writereg(state, 0x79 + i, cmd->msg[i]); in cx24110_send_diseqc_msg()
419 cx24110_writereg(state, 0x76, ((rv & 0x90) | 0x40) | ((cmd->msg_len-3) & 3)); in cx24110_send_diseqc_msg()
430 struct cx24110_state *state = fe->demodulator_priv; in cx24110_read_status()
458 struct cx24110_state *state = fe->demodulator_priv; in cx24110_read_ber()
464 state->lastber=cx24110_readreg(state,0x25)| in cx24110_read_ber()
469 *ber = state->lastber; in cx24110_read_ber()
476 struct cx24110_state *state = fe->demodulator_priv; in cx24110_read_signal_strength()
487 struct cx24110_state *state = fe->demodulator_priv; in cx24110_read_snr()
492 state->lastesn0=cx24110_readreg(state,0x69)| in cx24110_read_snr()
496 *snr = state->lastesn0; in cx24110_read_snr()
503 struct cx24110_state *state = fe->demodulator_priv; in cx24110_read_ucblocks()
512 state->lastbler=cx24110_readreg(state,0x12)| in cx24110_read_ucblocks()
517 *ucblocks = state->lastbler; in cx24110_read_ucblocks()
524 struct cx24110_state *state = fe->demodulator_priv; in cx24110_set_frontend()
525 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in cx24110_set_frontend()
527 if (fe->ops.tuner_ops.set_params) { in cx24110_set_frontend()
528 fe->ops.tuner_ops.set_params(fe); in cx24110_set_frontend()
529 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); in cx24110_set_frontend()
532 cx24110_set_inversion(state, p->inversion); in cx24110_set_frontend()
533 cx24110_set_fec(state, p->fec_inner); in cx24110_set_frontend()
534 cx24110_set_symbolrate(state, p->symbol_rate); in cx24110_set_frontend()
543 struct cx24110_state *state = fe->demodulator_priv; in cx24110_get_frontend()
560 p->frequency += afc; in cx24110_get_frontend()
561 p->inversion = (cx24110_readreg (state, 0x22) & 0x10) ? in cx24110_get_frontend()
563 p->fec_inner = cx24110_get_fec(state); in cx24110_get_frontend()
571 struct cx24110_state *state = fe->demodulator_priv; in cx24110_set_tone()
578 struct cx24110_state* state = fe->demodulator_priv; in cx24110_release()
595 state->config = config; in cx24110_attach()
596 state->i2c = i2c; in cx24110_attach()
597 state->lastber = 0; in cx24110_attach()
598 state->lastbler = 0; in cx24110_attach()
599 state->lastesn0 = 0; in cx24110_attach()
606 memcpy(&state->frontend.ops, &cx24110_ops, sizeof(struct dvb_frontend_ops)); in cx24110_attach()
607 state->frontend.demodulator_priv = state; in cx24110_attach()
608 return &state->frontend; in cx24110_attach()
618 .name = "Conexant CX24110 DVB-S",
652 MODULE_DESCRIPTION("Conexant CX24110 DVB-S Demodulator driver");