Commit ac3852c4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] dvb_frontend: Fix inversion breakage due to DVBv5 conversion

On several places inside dvb_frontend, only the DVBv3 parameters
were updated. Change it to be sure that, on all places, the DVBv5
parameters will be changed instead.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 63aad05b
...@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra ...@@ -288,12 +288,13 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
int ready = 0; int ready = 0;
int fe_set_err = 0; int fe_set_err = 0;
struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_frontend_private *fepriv = fe->frontend_priv;
int original_inversion = fepriv->parameters_in.inversion; struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
u32 original_frequency = fepriv->parameters_in.frequency; int original_inversion = c->inversion;
u32 original_frequency = c->frequency;
/* are we using autoinversion? */ /* are we using autoinversion? */
autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) && autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
(fepriv->parameters_in.inversion == INVERSION_AUTO)); (c->inversion == INVERSION_AUTO));
/* setup parameters correctly */ /* setup parameters correctly */
while(!ready) { while(!ready) {
...@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra ...@@ -359,19 +360,20 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step); fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step);
/* set the frontend itself */ /* set the frontend itself */
fepriv->parameters_in.frequency += fepriv->lnb_drift; c->frequency += fepriv->lnb_drift;
if (autoinversion) if (autoinversion)
fepriv->parameters_in.inversion = fepriv->inversion; c->inversion = fepriv->inversion;
tmp = *c;
if (fe->ops.set_frontend) if (fe->ops.set_frontend)
fe_set_err = fe->ops.set_frontend(fe); fe_set_err = fe->ops.set_frontend(fe);
fepriv->parameters_out = fepriv->parameters_in; *c = tmp;
if (fe_set_err < 0) { if (fe_set_err < 0) {
fepriv->state = FESTATE_ERROR; fepriv->state = FESTATE_ERROR;
return fe_set_err; return fe_set_err;
} }
fepriv->parameters_in.frequency = original_frequency; c->frequency = original_frequency;
fepriv->parameters_in.inversion = original_inversion; c->inversion = original_inversion;
fepriv->auto_sub_step++; fepriv->auto_sub_step++;
return 0; return 0;
...@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) ...@@ -382,6 +384,7 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
fe_status_t s = 0; fe_status_t s = 0;
int retval = 0; int retval = 0;
struct dvb_frontend_private *fepriv = fe->frontend_priv; struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
/* if we've got no parameters, just keep idling */ /* if we've got no parameters, just keep idling */
if (fepriv->state & FESTATE_IDLE) { if (fepriv->state & FESTATE_IDLE) {
...@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) ...@@ -393,9 +396,10 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
/* in SCAN mode, we just set the frontend when asked and leave it alone */ /* in SCAN mode, we just set the frontend when asked and leave it alone */
if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) { if (fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT) {
if (fepriv->state & FESTATE_RETUNE) { if (fepriv->state & FESTATE_RETUNE) {
tmp = *c;
if (fe->ops.set_frontend) if (fe->ops.set_frontend)
retval = fe->ops.set_frontend(fe); retval = fe->ops.set_frontend(fe);
fepriv->parameters_out = fepriv->parameters_in; *c = tmp;
if (retval < 0) if (retval < 0)
fepriv->state = FESTATE_ERROR; fepriv->state = FESTATE_ERROR;
else else
...@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) ...@@ -425,8 +429,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
/* if we're tuned, then we have determined the correct inversion */ /* if we're tuned, then we have determined the correct inversion */
if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) && if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) &&
(fepriv->parameters_in.inversion == INVERSION_AUTO)) { (c->inversion == INVERSION_AUTO)) {
fepriv->parameters_in.inversion = fepriv->inversion; c->inversion = fepriv->inversion;
} }
return; return;
} }
...@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file, ...@@ -1976,14 +1980,14 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
/* force auto frequency inversion if requested */ /* force auto frequency inversion if requested */
if (dvb_force_auto_inversion) { if (dvb_force_auto_inversion) {
fepriv->parameters_in.inversion = INVERSION_AUTO; c->inversion = INVERSION_AUTO;
} }
if (fe->ops.info.type == FE_OFDM) { if (fe->ops.info.type == FE_OFDM) {
/* without hierarchical coding code_rate_LP is irrelevant, /* without hierarchical coding code_rate_LP is irrelevant,
* so we tolerate the otherwise invalid FEC_NONE setting */ * so we tolerate the otherwise invalid FEC_NONE setting */
if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE && if (c->hierarchy == HIERARCHY_NONE &&
fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE) c->code_rate_LP == FEC_NONE)
fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO; c->code_rate_LP = FEC_AUTO;
} }
/* get frontend-specific tuning settings */ /* get frontend-specific tuning settings */
...@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file, ...@@ -1996,8 +2000,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
switch(fe->ops.info.type) { switch(fe->ops.info.type) {
case FE_QPSK: case FE_QPSK:
fepriv->min_delay = HZ/20; fepriv->min_delay = HZ/20;
fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000; fepriv->step_size = c->symbol_rate / 16000;
fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000; fepriv->max_drift = c->symbol_rate / 2000;
break; break;
case FE_QAM: case FE_QAM:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment