Commit 93ce675c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] mxl111sf-tuner: use DVBv5 parameters on set_params()

Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 66e6cd59
...@@ -275,52 +275,50 @@ static int mxl1x1sf_tuner_loop_thru_ctrl(struct mxl111sf_tuner_state *state, ...@@ -275,52 +275,50 @@ static int mxl1x1sf_tuner_loop_thru_ctrl(struct mxl111sf_tuner_state *state,
static int mxl111sf_tuner_set_params(struct dvb_frontend *fe, static int mxl111sf_tuner_set_params(struct dvb_frontend *fe,
struct dvb_frontend_parameters *params) struct dvb_frontend_parameters *params)
{ {
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
u32 delsys = c->delivery_system;
struct mxl111sf_tuner_state *state = fe->tuner_priv; struct mxl111sf_tuner_state *state = fe->tuner_priv;
int ret; int ret;
u8 bw; u8 bw;
u32 band = BANDWIDTH_6_MHZ;
mxl_dbg("()"); mxl_dbg("()");
if (fe->ops.info.type == FE_ATSC) { switch (delsys) {
switch (params->u.vsb.modulation) { case SYS_ATSC:
case VSB_8: bw = 0; /* ATSC */
case VSB_16: break;
bw = 0; /* ATSC */ case SYS_DVBC_ANNEX_B:
break; bw = 1; /* US CABLE */
case QAM_64: break;
case QAM_256: case SYS_DVBT:
bw = 1; /* US CABLE */ switch (c->bandwidth_hz) {
break; case 6000000:
default:
err("%s: modulation not set!", __func__);
return -EINVAL;
}
} else if (fe->ops.info.type == FE_OFDM) {
switch (params->u.ofdm.bandwidth) {
case BANDWIDTH_6_MHZ:
bw = 6; bw = 6;
break; break;
case BANDWIDTH_7_MHZ: case 7000000:
bw = 7; bw = 7;
band = BANDWIDTH_7_MHZ;
break; break;
case BANDWIDTH_8_MHZ: case 8000000:
bw = 8; bw = 8;
band = BANDWIDTH_8_MHZ;
break; break;
default: default:
err("%s: bandwidth not set!", __func__); err("%s: bandwidth not set!", __func__);
return -EINVAL; return -EINVAL;
} }
} else { break;
default:
err("%s: modulation type not supported!", __func__); err("%s: modulation type not supported!", __func__);
return -EINVAL; return -EINVAL;
} }
ret = mxl1x1sf_tune_rf(fe, params->frequency, bw); ret = mxl1x1sf_tune_rf(fe, c->frequency, bw);
if (mxl_fail(ret)) if (mxl_fail(ret))
goto fail; goto fail;
state->frequency = params->frequency; state->frequency = c->frequency;
state->bandwidth = (fe->ops.info.type == FE_OFDM) ? state->bandwidth = band;
params->u.ofdm.bandwidth : 0;
fail: fail:
return ret; return ret;
} }
......
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