[media] cx23123: convert set_fontend to use DVBv5 parameters
Instead of using dvb_frontend_parameters struct, that were designed for a subset of the supported standards, use the DVBv5 cache information. Also, fill the supported delivery systems at dvb_frontend_ops struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
b5c7cfd15d
commit
a73efc05b7
@ -526,9 +526,9 @@ static int cx24123_set_symbolrate(struct cx24123_state *state, u32 srate)
|
|||||||
* to be configured and the correct band selected.
|
* to be configured and the correct band selected.
|
||||||
* Calculate those values.
|
* Calculate those values.
|
||||||
*/
|
*/
|
||||||
static int cx24123_pll_calculate(struct dvb_frontend *fe,
|
static int cx24123_pll_calculate(struct dvb_frontend *fe)
|
||||||
struct dvb_frontend_parameters *p)
|
|
||||||
{
|
{
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct cx24123_state *state = fe->demodulator_priv;
|
struct cx24123_state *state = fe->demodulator_priv;
|
||||||
u32 ndiv = 0, adiv = 0, vco_div = 0;
|
u32 ndiv = 0, adiv = 0, vco_div = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -548,8 +548,8 @@ static int cx24123_pll_calculate(struct dvb_frontend *fe,
|
|||||||
* FILTUNE programming bits */
|
* FILTUNE programming bits */
|
||||||
for (i = 0; i < ARRAY_SIZE(cx24123_AGC_vals); i++) {
|
for (i = 0; i < ARRAY_SIZE(cx24123_AGC_vals); i++) {
|
||||||
agcv = &cx24123_AGC_vals[i];
|
agcv = &cx24123_AGC_vals[i];
|
||||||
if ((agcv->symbolrate_low <= p->u.qpsk.symbol_rate) &&
|
if ((agcv->symbolrate_low <= p->symbol_rate) &&
|
||||||
(agcv->symbolrate_high >= p->u.qpsk.symbol_rate)) {
|
(agcv->symbolrate_high >= p->symbol_rate)) {
|
||||||
state->VCAarg = agcv->VCAprogdata;
|
state->VCAarg = agcv->VCAprogdata;
|
||||||
state->VGAarg = agcv->VGAprogdata;
|
state->VGAarg = agcv->VGAprogdata;
|
||||||
state->FILTune = agcv->FILTune;
|
state->FILTune = agcv->FILTune;
|
||||||
@ -658,15 +658,15 @@ static int cx24123_pll_writereg(struct dvb_frontend *fe, u32 data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24123_pll_tune(struct dvb_frontend *fe,
|
static int cx24123_pll_tune(struct dvb_frontend *fe)
|
||||||
struct dvb_frontend_parameters *p)
|
|
||||||
{
|
{
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
struct cx24123_state *state = fe->demodulator_priv;
|
struct cx24123_state *state = fe->demodulator_priv;
|
||||||
u8 val;
|
u8 val;
|
||||||
|
|
||||||
dprintk("frequency=%i\n", p->frequency);
|
dprintk("frequency=%i\n", p->frequency);
|
||||||
|
|
||||||
if (cx24123_pll_calculate(fe, p) != 0) {
|
if (cx24123_pll_calculate(fe) != 0) {
|
||||||
err("%s: cx24123_pll_calcutate failed\n", __func__);
|
err("%s: cx24123_pll_calcutate failed\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -924,10 +924,10 @@ static int cx24123_read_snr(struct dvb_frontend *fe, u16 *snr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24123_set_frontend(struct dvb_frontend *fe,
|
static int cx24123_set_frontend(struct dvb_frontend *fe)
|
||||||
struct dvb_frontend_parameters *p)
|
|
||||||
{
|
{
|
||||||
struct cx24123_state *state = fe->demodulator_priv;
|
struct cx24123_state *state = fe->demodulator_priv;
|
||||||
|
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
|
||||||
|
|
||||||
dprintk("\n");
|
dprintk("\n");
|
||||||
|
|
||||||
@ -935,14 +935,14 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
|
|||||||
state->config->set_ts_params(fe, 0);
|
state->config->set_ts_params(fe, 0);
|
||||||
|
|
||||||
state->currentfreq = p->frequency;
|
state->currentfreq = p->frequency;
|
||||||
state->currentsymbolrate = p->u.qpsk.symbol_rate;
|
state->currentsymbolrate = p->symbol_rate;
|
||||||
|
|
||||||
cx24123_set_inversion(state, p->inversion);
|
cx24123_set_inversion(state, p->inversion);
|
||||||
cx24123_set_fec(state, p->u.qpsk.fec_inner);
|
cx24123_set_fec(state, p->fec_inner);
|
||||||
cx24123_set_symbolrate(state, p->u.qpsk.symbol_rate);
|
cx24123_set_symbolrate(state, p->symbol_rate);
|
||||||
|
|
||||||
if (!state->config->dont_use_pll)
|
if (!state->config->dont_use_pll)
|
||||||
cx24123_pll_tune(fe, p);
|
cx24123_pll_tune(fe);
|
||||||
else if (fe->ops.tuner_ops.set_params)
|
else if (fe->ops.tuner_ops.set_params)
|
||||||
fe->ops.tuner_ops.set_params(fe);
|
fe->ops.tuner_ops.set_params(fe);
|
||||||
else
|
else
|
||||||
@ -960,7 +960,7 @@ static int cx24123_set_frontend(struct dvb_frontend *fe,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cx24123_get_frontend(struct dvb_frontend *fe,
|
static int cx24123_get_frontend(struct dvb_frontend *fe,
|
||||||
struct dvb_frontend_parameters *p)
|
struct dtv_frontend_properties *p)
|
||||||
{
|
{
|
||||||
struct cx24123_state *state = fe->demodulator_priv;
|
struct cx24123_state *state = fe->demodulator_priv;
|
||||||
|
|
||||||
@ -970,12 +970,12 @@ static int cx24123_get_frontend(struct dvb_frontend *fe,
|
|||||||
err("%s: Failed to get inversion status\n", __func__);
|
err("%s: Failed to get inversion status\n", __func__);
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
}
|
}
|
||||||
if (cx24123_get_fec(state, &p->u.qpsk.fec_inner) != 0) {
|
if (cx24123_get_fec(state, &p->fec_inner) != 0) {
|
||||||
err("%s: Failed to get fec status\n", __func__);
|
err("%s: Failed to get fec status\n", __func__);
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
}
|
}
|
||||||
p->frequency = state->currentfreq;
|
p->frequency = state->currentfreq;
|
||||||
p->u.qpsk.symbol_rate = state->currentsymbolrate;
|
p->symbol_rate = state->currentsymbolrate;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1014,7 +1014,7 @@ static int cx24123_tune(struct dvb_frontend *fe,
|
|||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
if (params != NULL)
|
if (params != NULL)
|
||||||
retval = cx24123_set_frontend(fe, params);
|
retval = cx24123_set_frontend(fe);
|
||||||
|
|
||||||
if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
|
if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
|
||||||
cx24123_read_status(fe, status);
|
cx24123_read_status(fe, status);
|
||||||
@ -1125,7 +1125,7 @@ error:
|
|||||||
EXPORT_SYMBOL(cx24123_attach);
|
EXPORT_SYMBOL(cx24123_attach);
|
||||||
|
|
||||||
static struct dvb_frontend_ops cx24123_ops = {
|
static struct dvb_frontend_ops cx24123_ops = {
|
||||||
|
.delsys = { SYS_DVBS },
|
||||||
.info = {
|
.info = {
|
||||||
.name = "Conexant CX24123/CX24109",
|
.name = "Conexant CX24123/CX24109",
|
||||||
.type = FE_QPSK,
|
.type = FE_QPSK,
|
||||||
@ -1145,8 +1145,8 @@ static struct dvb_frontend_ops cx24123_ops = {
|
|||||||
.release = cx24123_release,
|
.release = cx24123_release,
|
||||||
|
|
||||||
.init = cx24123_initfe,
|
.init = cx24123_initfe,
|
||||||
.set_frontend_legacy = cx24123_set_frontend,
|
.set_frontend = cx24123_set_frontend,
|
||||||
.get_frontend_legacy = cx24123_get_frontend,
|
.get_frontend = cx24123_get_frontend,
|
||||||
.read_status = cx24123_read_status,
|
.read_status = cx24123_read_status,
|
||||||
.read_ber = cx24123_read_ber,
|
.read_ber = cx24123_read_ber,
|
||||||
.read_signal_strength = cx24123_read_signal_strength,
|
.read_signal_strength = cx24123_read_signal_strength,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user