Commit 40d6f2b8 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] xc4000: 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 506cd714
...@@ -1124,80 +1124,67 @@ static void xc_debug_dump(struct xc4000_priv *priv) ...@@ -1124,80 +1124,67 @@ static void xc_debug_dump(struct xc4000_priv *priv)
static int xc4000_set_params(struct dvb_frontend *fe, static int xc4000_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;
struct xc4000_priv *priv = fe->tuner_priv; struct xc4000_priv *priv = fe->tuner_priv;
unsigned int type; unsigned int type;
int ret = -EREMOTEIO; int ret = -EREMOTEIO;
dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); dprintk(1, "%s() frequency=%d (Hz)\n", __func__, c->frequency);
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
if (fe->ops.info.type == FE_ATSC) { switch (delsys) {
dprintk(1, "%s() ATSC\n", __func__); case SYS_ATSC:
switch (params->u.vsb.modulation) {
case VSB_8:
case VSB_16:
dprintk(1, "%s() VSB modulation\n", __func__); dprintk(1, "%s() VSB modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_AIR; priv->rf_mode = XC_RF_MODE_AIR;
priv->freq_hz = params->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ; priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
type = DTV6; type = DTV6;
break; break;
case QAM_64: case SYS_DVBC_ANNEX_B:
case QAM_256:
case QAM_AUTO:
dprintk(1, "%s() QAM modulation\n", __func__); dprintk(1, "%s() QAM modulation\n", __func__);
priv->rf_mode = XC_RF_MODE_CABLE; priv->rf_mode = XC_RF_MODE_CABLE;
priv->freq_hz = params->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
priv->bandwidth = BANDWIDTH_6_MHZ; priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
type = DTV6; type = DTV6;
break; break;
default: case SYS_DVBT:
ret = -EINVAL; case SYS_DVBT2:
goto fail;
}
} else if (fe->ops.info.type == FE_OFDM) {
dprintk(1, "%s() OFDM\n", __func__); dprintk(1, "%s() OFDM\n", __func__);
switch (params->u.ofdm.bandwidth) { if (bw == 0) {
case BANDWIDTH_6_MHZ: if (c->frequency < 400000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->freq_hz = c->frequency - 2250000;
} else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->freq_hz = c->frequency - 2750000;
}
priv->video_standard = XC4000_DTV7_8;
type = DTV78;
} else if (bw <= 6000000) {
priv->bandwidth = BANDWIDTH_6_MHZ; priv->bandwidth = BANDWIDTH_6_MHZ;
priv->video_standard = XC4000_DTV6; priv->video_standard = XC4000_DTV6;
priv->freq_hz = params->frequency - 1750000; priv->freq_hz = c->frequency - 1750000;
type = DTV6; type = DTV6;
break; } else if (bw <= 7000000) {
case BANDWIDTH_7_MHZ:
priv->bandwidth = BANDWIDTH_7_MHZ; priv->bandwidth = BANDWIDTH_7_MHZ;
priv->video_standard = XC4000_DTV7; priv->video_standard = XC4000_DTV7;
priv->freq_hz = params->frequency - 2250000; priv->freq_hz = c->frequency - 2250000;
type = DTV7; type = DTV7;
break; } else {
case BANDWIDTH_8_MHZ:
priv->bandwidth = BANDWIDTH_8_MHZ; priv->bandwidth = BANDWIDTH_8_MHZ;
priv->video_standard = XC4000_DTV8; priv->video_standard = XC4000_DTV8;
priv->freq_hz = params->frequency - 2750000; priv->freq_hz = c->frequency - 2750000;
type = DTV8; type = DTV8;
break;
case BANDWIDTH_AUTO:
if (params->frequency < 400000000) {
priv->bandwidth = BANDWIDTH_7_MHZ;
priv->freq_hz = params->frequency - 2250000;
} else {
priv->bandwidth = BANDWIDTH_8_MHZ;
priv->freq_hz = params->frequency - 2750000;
} }
priv->video_standard = XC4000_DTV7_8; priv->rf_mode = XC_RF_MODE_AIR;
type = DTV78;
break; break;
default: default:
printk(KERN_ERR "xc4000 bandwidth not set!\n"); printk(KERN_ERR "xc4000 delivery system not supported!\n");
ret = -EINVAL;
goto fail;
}
priv->rf_mode = XC_RF_MODE_AIR;
} else {
printk(KERN_ERR "xc4000 modulation type not supported!\n");
ret = -EINVAL; ret = -EINVAL;
goto fail; goto fail;
} }
......
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