提交 5ca1c94d 编写于 作者: M Mauro Carvalho Chehab

[media] tda18271-fe: use DVBv5 parameters on set_params()

Instead of using DVBv3 parameters, rely on DVBv5 parameters to
set the tuner.
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ce0e93a5
...@@ -931,56 +931,51 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -931,56 +931,51 @@ static int tda18271_tune(struct dvb_frontend *fe,
static int tda18271_set_params(struct dvb_frontend *fe, static int tda18271_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;
u32 bw = c->bandwidth_hz;
u32 freq = c->frequency;
u32 band = BANDWIDTH_6_MHZ;
struct tda18271_priv *priv = fe->tuner_priv; struct tda18271_priv *priv = fe->tuner_priv;
struct tda18271_std_map *std_map = &priv->std; struct tda18271_std_map *std_map = &priv->std;
struct tda18271_std_map_item *map; struct tda18271_std_map_item *map;
int ret; int ret;
u32 bw, freq = params->frequency;
priv->mode = TDA18271_DIGITAL; priv->mode = TDA18271_DIGITAL;
if (fe->ops.info.type == FE_ATSC) { switch (delsys) {
switch (params->u.vsb.modulation) { case SYS_ATSC:
case VSB_8: map = &std_map->atsc_6;
case VSB_16:
map = &std_map->atsc_6;
break;
case QAM_64:
case QAM_256:
map = &std_map->qam_6;
break;
default:
tda_warn("modulation not set!\n");
return -EINVAL;
}
#if 0
/* userspace request is already center adjusted */
freq += 1750000; /* Adjust to center (+1.75MHZ) */
#endif
bw = 6000000; bw = 6000000;
} else if (fe->ops.info.type == FE_OFDM) { break;
switch (params->u.ofdm.bandwidth) { case SYS_DVBT:
case BANDWIDTH_6_MHZ: case SYS_DVBT2:
bw = 6000000; if (bw <= 6000000) {
map = &std_map->dvbt_6; map = &std_map->dvbt_6;
break; } else if (bw <= 7000000) {
case BANDWIDTH_7_MHZ:
bw = 7000000;
map = &std_map->dvbt_7; map = &std_map->dvbt_7;
break; band = BANDWIDTH_7_MHZ;
case BANDWIDTH_8_MHZ: } else {
bw = 8000000;
map = &std_map->dvbt_8; map = &std_map->dvbt_8;
break; band = BANDWIDTH_8_MHZ;
default:
tda_warn("bandwidth not set!\n");
return -EINVAL;
} }
} else if (fe->ops.info.type == FE_QAM) { break;
/* DVB-C */ case SYS_DVBC_ANNEX_B:
map = &std_map->qam_8; bw = 6000000;
bw = 8000000; /* falltrough */
} else { case SYS_DVBC_ANNEX_A:
case SYS_DVBC_ANNEX_C:
if (bw <= 6000000) {
map = &std_map->qam_6;
} else if (bw <= 7000000) {
map = &std_map->qam_7;
band = BANDWIDTH_7_MHZ;
} else {
map = &std_map->qam_8;
band = BANDWIDTH_8_MHZ;
}
break;
default:
tda_warn("modulation type not supported!\n"); tda_warn("modulation type not supported!\n");
return -EINVAL; return -EINVAL;
} }
...@@ -996,8 +991,7 @@ static int tda18271_set_params(struct dvb_frontend *fe, ...@@ -996,8 +991,7 @@ static int tda18271_set_params(struct dvb_frontend *fe,
priv->if_freq = map->if_freq; priv->if_freq = map->if_freq;
priv->frequency = freq; priv->frequency = freq;
priv->bandwidth = (fe->ops.info.type == FE_OFDM) ? priv->bandwidth = band;
params->u.ofdm.bandwidth : 0;
fail: fail:
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册