Commit 531157b3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] mxl111sf-demod: 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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6e07d5c5
...@@ -102,8 +102,8 @@ int mxl1x1sf_demod_get_tps_code_rate(struct mxl111sf_demod_state *state, ...@@ -102,8 +102,8 @@ int mxl1x1sf_demod_get_tps_code_rate(struct mxl111sf_demod_state *state,
} }
static static
int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state, int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state,
fe_modulation_t *constellation) fe_modulation_t *modulation)
{ {
u8 val; u8 val;
int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val); int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val);
...@@ -113,13 +113,13 @@ int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state, ...@@ -113,13 +113,13 @@ int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state,
switch ((val & V6_PARAM_CONSTELLATION_MASK) >> 4) { switch ((val & V6_PARAM_CONSTELLATION_MASK) >> 4) {
case 0: case 0:
*constellation = QPSK; *modulation = QPSK;
break; break;
case 1: case 1:
*constellation = QAM_16; *modulation = QAM_16;
break; break;
case 2: case 2:
*constellation = QAM_64; *modulation = QAM_64;
break; break;
} }
fail: fail:
...@@ -284,8 +284,7 @@ static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state) ...@@ -284,8 +284,7 @@ static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state)
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe, static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe)
struct dvb_frontend_parameters *param)
{ {
struct mxl111sf_demod_state *state = fe->demodulator_priv; struct mxl111sf_demod_state *state = fe->demodulator_priv;
int ret = 0; int ret = 0;
...@@ -481,13 +480,13 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe, ...@@ -481,13 +480,13 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
u16 *signal_strength) u16 *signal_strength)
{ {
struct mxl111sf_demod_state *state = fe->demodulator_priv; struct mxl111sf_demod_state *state = fe->demodulator_priv;
fe_modulation_t constellation; fe_modulation_t modulation;
u16 snr; u16 snr;
mxl111sf_demod_calc_snr(state, &snr); mxl111sf_demod_calc_snr(state, &snr);
mxl1x1sf_demod_get_tps_constellation(state, &constellation); mxl1x1sf_demod_get_tps_modulation(state, &modulation);
switch (constellation) { switch (modulation) {
case QPSK: case QPSK:
*signal_strength = (snr >= 1300) ? *signal_strength = (snr >= 1300) ?
min(65535, snr * 44) : snr * 38; min(65535, snr * 44) : snr * 38;
...@@ -509,7 +508,7 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe, ...@@ -509,7 +508,7 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
} }
static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe, static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p) struct dtv_frontend_properties *p)
{ {
struct mxl111sf_demod_state *state = fe->demodulator_priv; struct mxl111sf_demod_state *state = fe->demodulator_priv;
...@@ -518,18 +517,18 @@ static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe, ...@@ -518,18 +517,18 @@ static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
p->inversion = /* FIXME */ ? INVERSION_ON : INVERSION_OFF; p->inversion = /* FIXME */ ? INVERSION_ON : INVERSION_OFF;
#endif #endif
if (fe->ops.tuner_ops.get_bandwidth) if (fe->ops.tuner_ops.get_bandwidth)
fe->ops.tuner_ops.get_bandwidth(fe, &p->u.ofdm.bandwidth); fe->ops.tuner_ops.get_bandwidth(fe, &p->bandwidth_hz);
if (fe->ops.tuner_ops.get_frequency) if (fe->ops.tuner_ops.get_frequency)
fe->ops.tuner_ops.get_frequency(fe, &p->frequency); fe->ops.tuner_ops.get_frequency(fe, &p->frequency);
mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_HP); mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_HP);
mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_LP); mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_LP);
mxl1x1sf_demod_get_tps_constellation(state, &p->u.ofdm.constellation); mxl1x1sf_demod_get_tps_modulation(state, &p->modulation);
mxl1x1sf_demod_get_tps_guard_fft_mode(state, mxl1x1sf_demod_get_tps_guard_fft_mode(state,
&p->u.ofdm.transmission_mode); &p->transmission_mode);
mxl1x1sf_demod_get_tps_guard_interval(state, mxl1x1sf_demod_get_tps_guard_interval(state,
&p->u.ofdm.guard_interval); &p->guard_interval);
mxl1x1sf_demod_get_tps_hierarchy(state, mxl1x1sf_demod_get_tps_hierarchy(state,
&p->u.ofdm.hierarchy_information); &p->hierarchy);
return 0; return 0;
} }
...@@ -551,7 +550,7 @@ static void mxl111sf_demod_release(struct dvb_frontend *fe) ...@@ -551,7 +550,7 @@ static void mxl111sf_demod_release(struct dvb_frontend *fe)
} }
static struct dvb_frontend_ops mxl111sf_demod_ops = { static struct dvb_frontend_ops mxl111sf_demod_ops = {
.delsys = { SYS_DVBT },
.info = { .info = {
.name = "MaxLinear MxL111SF DVB-T demodulator", .name = "MaxLinear MxL111SF DVB-T demodulator",
.type = FE_OFDM, .type = FE_OFDM,
...@@ -570,8 +569,8 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = { ...@@ -570,8 +569,8 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
.init = mxl111sf_init, .init = mxl111sf_init,
.i2c_gate_ctrl = mxl111sf_i2c_gate_ctrl, .i2c_gate_ctrl = mxl111sf_i2c_gate_ctrl,
#endif #endif
.set_frontend_legacy = mxl111sf_demod_set_frontend, .set_frontend = mxl111sf_demod_set_frontend,
.get_frontend_legacy = mxl111sf_demod_get_frontend, .get_frontend = mxl111sf_demod_get_frontend,
.get_tune_settings = mxl111sf_demod_get_tune_settings, .get_tune_settings = mxl111sf_demod_get_tune_settings,
.read_status = mxl111sf_demod_read_status, .read_status = mxl111sf_demod_read_status,
.read_signal_strength = mxl111sf_demod_read_signal_strength, .read_signal_strength = mxl111sf_demod_read_signal_strength,
......
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