[media] dst: 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:
Mauro Carvalho Chehab 2011-12-26 15:26:49 -03:00
parent dfc6438410
commit 5942c679a8

View File

@ -386,7 +386,7 @@ static int dst_set_freq(struct dst_state *state, u32 freq)
return 0; return 0;
} }
static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth) static int dst_set_bandwidth(struct dst_state *state, u32 bandwidth)
{ {
state->bandwidth = bandwidth; state->bandwidth = bandwidth;
@ -394,7 +394,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
return -EOPNOTSUPP; return -EOPNOTSUPP;
switch (bandwidth) { switch (bandwidth) {
case BANDWIDTH_6_MHZ: case 6000000:
if (state->dst_hw_cap & DST_TYPE_HAS_CA) if (state->dst_hw_cap & DST_TYPE_HAS_CA)
state->tx_tuna[7] = 0x06; state->tx_tuna[7] = 0x06;
else { else {
@ -402,7 +402,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
state->tx_tuna[7] = 0x00; state->tx_tuna[7] = 0x00;
} }
break; break;
case BANDWIDTH_7_MHZ: case 7000000:
if (state->dst_hw_cap & DST_TYPE_HAS_CA) if (state->dst_hw_cap & DST_TYPE_HAS_CA)
state->tx_tuna[7] = 0x07; state->tx_tuna[7] = 0x07;
else { else {
@ -410,7 +410,7 @@ static int dst_set_bandwidth(struct dst_state *state, fe_bandwidth_t bandwidth)
state->tx_tuna[7] = 0x00; state->tx_tuna[7] = 0x00;
} }
break; break;
case BANDWIDTH_8_MHZ: case 8000000:
if (state->dst_hw_cap & DST_TYPE_HAS_CA) if (state->dst_hw_cap & DST_TYPE_HAS_CA)
state->tx_tuna[7] = 0x08; state->tx_tuna[7] = 0x08;
else { else {
@ -1561,7 +1561,7 @@ static int dst_init(struct dvb_frontend *fe)
state->tone = SEC_TONE_OFF; state->tone = SEC_TONE_OFF;
state->diseq_flags = 0; state->diseq_flags = 0;
state->k22 = 0x02; state->k22 = 0x02;
state->bandwidth = BANDWIDTH_7_MHZ; state->bandwidth = 7000000;
state->cur_jiff = jiffies; state->cur_jiff = jiffies;
if (state->dst_type == DST_TYPE_IS_SAT) if (state->dst_type == DST_TYPE_IS_SAT)
memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_VLF) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204)); memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_VLF) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204));
@ -1609,8 +1609,9 @@ static int dst_read_snr(struct dvb_frontend *fe, u16 *snr)
return retval; return retval;
} }
static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) static int dst_set_frontend(struct dvb_frontend *fe)
{ {
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
int retval = -EINVAL; int retval = -EINVAL;
struct dst_state *state = fe->demodulator_priv; struct dst_state *state = fe->demodulator_priv;
@ -1623,17 +1624,17 @@ static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
if (state->dst_type == DST_TYPE_IS_SAT) { if (state->dst_type == DST_TYPE_IS_SAT) {
if (state->type_flags & DST_TYPE_HAS_OBS_REGS) if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
dst_set_inversion(state, p->inversion); dst_set_inversion(state, p->inversion);
dst_set_fec(state, p->u.qpsk.fec_inner); dst_set_fec(state, p->fec_inner);
dst_set_symbolrate(state, p->u.qpsk.symbol_rate); dst_set_symbolrate(state, p->symbol_rate);
dst_set_polarization(state); dst_set_polarization(state);
dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate); dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->symbol_rate);
} else if (state->dst_type == DST_TYPE_IS_TERR) } else if (state->dst_type == DST_TYPE_IS_TERR)
dst_set_bandwidth(state, p->u.ofdm.bandwidth); dst_set_bandwidth(state, p->bandwidth_hz);
else if (state->dst_type == DST_TYPE_IS_CABLE) { else if (state->dst_type == DST_TYPE_IS_CABLE) {
dst_set_fec(state, p->u.qam.fec_inner); dst_set_fec(state, p->fec_inner);
dst_set_symbolrate(state, p->u.qam.symbol_rate); dst_set_symbolrate(state, p->symbol_rate);
dst_set_modulation(state, p->u.qam.modulation); dst_set_modulation(state, p->modulation);
} }
retval = dst_write_tuna(fe); retval = dst_write_tuna(fe);
} }
@ -1683,7 +1684,7 @@ static int dst_get_tuning_algo(struct dvb_frontend *fe)
return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW; return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW;
} }
static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) static int dst_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p)
{ {
struct dst_state *state = fe->demodulator_priv; struct dst_state *state = fe->demodulator_priv;
@ -1691,14 +1692,14 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet
if (state->dst_type == DST_TYPE_IS_SAT) { if (state->dst_type == DST_TYPE_IS_SAT) {
if (state->type_flags & DST_TYPE_HAS_OBS_REGS) if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
p->inversion = state->inversion; p->inversion = state->inversion;
p->u.qpsk.symbol_rate = state->symbol_rate; p->symbol_rate = state->symbol_rate;
p->u.qpsk.fec_inner = dst_get_fec(state); p->fec_inner = dst_get_fec(state);
} else if (state->dst_type == DST_TYPE_IS_TERR) { } else if (state->dst_type == DST_TYPE_IS_TERR) {
p->u.ofdm.bandwidth = state->bandwidth; p->bandwidth_hz = state->bandwidth;
} else if (state->dst_type == DST_TYPE_IS_CABLE) { } else if (state->dst_type == DST_TYPE_IS_CABLE) {
p->u.qam.symbol_rate = state->symbol_rate; p->symbol_rate = state->symbol_rate;
p->u.qam.fec_inner = dst_get_fec(state); p->fec_inner = dst_get_fec(state);
p->u.qam.modulation = dst_get_modulation(state); p->modulation = dst_get_modulation(state);
} }
return 0; return 0;
@ -1756,7 +1757,7 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
EXPORT_SYMBOL(dst_attach); EXPORT_SYMBOL(dst_attach);
static struct dvb_frontend_ops dst_dvbt_ops = { static struct dvb_frontend_ops dst_dvbt_ops = {
.delsys = { SYS_DVBT },
.info = { .info = {
.name = "DST DVB-T", .name = "DST DVB-T",
.type = FE_OFDM, .type = FE_OFDM,
@ -1777,8 +1778,8 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.tune = dst_tune_frontend, .tune = dst_tune_frontend,
.set_frontend_legacy = dst_set_frontend, .set_frontend = dst_set_frontend,
.get_frontend_legacy = dst_get_frontend, .get_frontend = dst_get_frontend,
.get_frontend_algo = dst_get_tuning_algo, .get_frontend_algo = dst_get_tuning_algo,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
@ -1786,7 +1787,7 @@ static struct dvb_frontend_ops dst_dvbt_ops = {
}; };
static struct dvb_frontend_ops dst_dvbs_ops = { static struct dvb_frontend_ops dst_dvbs_ops = {
.delsys = { SYS_DVBS },
.info = { .info = {
.name = "DST DVB-S", .name = "DST DVB-S",
.type = FE_QPSK, .type = FE_QPSK,
@ -1803,8 +1804,8 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.tune = dst_tune_frontend, .tune = dst_tune_frontend,
.set_frontend_legacy = dst_set_frontend, .set_frontend = dst_set_frontend,
.get_frontend_legacy = dst_get_frontend, .get_frontend = dst_get_frontend,
.get_frontend_algo = dst_get_tuning_algo, .get_frontend_algo = dst_get_tuning_algo,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
@ -1816,7 +1817,7 @@ static struct dvb_frontend_ops dst_dvbs_ops = {
}; };
static struct dvb_frontend_ops dst_dvbc_ops = { static struct dvb_frontend_ops dst_dvbc_ops = {
.delsys = { SYS_DVBC_ANNEX_A },
.info = { .info = {
.name = "DST DVB-C", .name = "DST DVB-C",
.type = FE_QAM, .type = FE_QAM,
@ -1837,8 +1838,8 @@ static struct dvb_frontend_ops dst_dvbc_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.tune = dst_tune_frontend, .tune = dst_tune_frontend,
.set_frontend_legacy = dst_set_frontend, .set_frontend = dst_set_frontend,
.get_frontend_legacy = dst_get_frontend, .get_frontend = dst_get_frontend,
.get_frontend_algo = dst_get_tuning_algo, .get_frontend_algo = dst_get_tuning_algo,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,
@ -1860,8 +1861,8 @@ static struct dvb_frontend_ops dst_atsc_ops = {
.release = dst_release, .release = dst_release,
.init = dst_init, .init = dst_init,
.tune = dst_tune_frontend, .tune = dst_tune_frontend,
.set_frontend_legacy = dst_set_frontend, .set_frontend = dst_set_frontend,
.get_frontend_legacy = dst_get_frontend, .get_frontend = dst_get_frontend,
.get_frontend_algo = dst_get_tuning_algo, .get_frontend_algo = dst_get_tuning_algo,
.read_status = dst_read_status, .read_status = dst_read_status,
.read_signal_strength = dst_read_signal_strength, .read_signal_strength = dst_read_signal_strength,