diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 13:55:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 06:55:01 -0500 |
commit | 531157b35c778ba2790cd4e4aa99779774db260f (patch) | |
tree | 8c8c109d2993e003cb814cc7d50b1ec1940812cc | |
parent | 6e07d5c52d11496a50d82a69a018c013139f5d07 (diff) |
[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: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/dvb-usb/mxl111sf-demod.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c index b798cc817eaf..c61f246744f0 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf-demod.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf-demod.c | |||
@@ -102,8 +102,8 @@ fail: | |||
102 | } | 102 | } |
103 | 103 | ||
104 | static | 104 | static |
105 | int mxl1x1sf_demod_get_tps_constellation(struct mxl111sf_demod_state *state, | 105 | int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state, |
106 | fe_modulation_t *constellation) | 106 | fe_modulation_t *modulation) |
107 | { | 107 | { |
108 | u8 val; | 108 | u8 val; |
109 | int ret = mxl111sf_demod_read_reg(state, V6_MODORDER_TPS_REG, &val); | 109 | 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 | 113 | ||
114 | switch ((val & V6_PARAM_CONSTELLATION_MASK) >> 4) { | 114 | switch ((val & V6_PARAM_CONSTELLATION_MASK) >> 4) { |
115 | case 0: | 115 | case 0: |
116 | *constellation = QPSK; | 116 | *modulation = QPSK; |
117 | break; | 117 | break; |
118 | case 1: | 118 | case 1: |
119 | *constellation = QAM_16; | 119 | *modulation = QAM_16; |
120 | break; | 120 | break; |
121 | case 2: | 121 | case 2: |
122 | *constellation = QAM_64; | 122 | *modulation = QAM_64; |
123 | break; | 123 | break; |
124 | } | 124 | } |
125 | fail: | 125 | fail: |
@@ -284,8 +284,7 @@ static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state) | |||
284 | 284 | ||
285 | /* ------------------------------------------------------------------------ */ | 285 | /* ------------------------------------------------------------------------ */ |
286 | 286 | ||
287 | static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe, | 287 | static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe) |
288 | struct dvb_frontend_parameters *param) | ||
289 | { | 288 | { |
290 | struct mxl111sf_demod_state *state = fe->demodulator_priv; | 289 | struct mxl111sf_demod_state *state = fe->demodulator_priv; |
291 | int ret = 0; | 290 | int ret = 0; |
@@ -481,13 +480,13 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe, | |||
481 | u16 *signal_strength) | 480 | u16 *signal_strength) |
482 | { | 481 | { |
483 | struct mxl111sf_demod_state *state = fe->demodulator_priv; | 482 | struct mxl111sf_demod_state *state = fe->demodulator_priv; |
484 | fe_modulation_t constellation; | 483 | fe_modulation_t modulation; |
485 | u16 snr; | 484 | u16 snr; |
486 | 485 | ||
487 | mxl111sf_demod_calc_snr(state, &snr); | 486 | mxl111sf_demod_calc_snr(state, &snr); |
488 | mxl1x1sf_demod_get_tps_constellation(state, &constellation); | 487 | mxl1x1sf_demod_get_tps_modulation(state, &modulation); |
489 | 488 | ||
490 | switch (constellation) { | 489 | switch (modulation) { |
491 | case QPSK: | 490 | case QPSK: |
492 | *signal_strength = (snr >= 1300) ? | 491 | *signal_strength = (snr >= 1300) ? |
493 | min(65535, snr * 44) : snr * 38; | 492 | min(65535, snr * 44) : snr * 38; |
@@ -509,7 +508,7 @@ static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe, | |||
509 | } | 508 | } |
510 | 509 | ||
511 | static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe, | 510 | static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe, |
512 | struct dvb_frontend_parameters *p) | 511 | struct dtv_frontend_properties *p) |
513 | { | 512 | { |
514 | struct mxl111sf_demod_state *state = fe->demodulator_priv; | 513 | struct mxl111sf_demod_state *state = fe->demodulator_priv; |
515 | 514 | ||
@@ -518,18 +517,18 @@ static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe, | |||
518 | p->inversion = /* FIXME */ ? INVERSION_ON : INVERSION_OFF; | 517 | p->inversion = /* FIXME */ ? INVERSION_ON : INVERSION_OFF; |
519 | #endif | 518 | #endif |
520 | if (fe->ops.tuner_ops.get_bandwidth) | 519 | if (fe->ops.tuner_ops.get_bandwidth) |
521 | fe->ops.tuner_ops.get_bandwidth(fe, &p->u.ofdm.bandwidth); | 520 | fe->ops.tuner_ops.get_bandwidth(fe, &p->bandwidth_hz); |
522 | if (fe->ops.tuner_ops.get_frequency) | 521 | if (fe->ops.tuner_ops.get_frequency) |
523 | fe->ops.tuner_ops.get_frequency(fe, &p->frequency); | 522 | fe->ops.tuner_ops.get_frequency(fe, &p->frequency); |
524 | mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_HP); | 523 | mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_HP); |
525 | mxl1x1sf_demod_get_tps_code_rate(state, &p->u.ofdm.code_rate_LP); | 524 | mxl1x1sf_demod_get_tps_code_rate(state, &p->code_rate_LP); |
526 | mxl1x1sf_demod_get_tps_constellation(state, &p->u.ofdm.constellation); | 525 | mxl1x1sf_demod_get_tps_modulation(state, &p->modulation); |
527 | mxl1x1sf_demod_get_tps_guard_fft_mode(state, | 526 | mxl1x1sf_demod_get_tps_guard_fft_mode(state, |
528 | &p->u.ofdm.transmission_mode); | 527 | &p->transmission_mode); |
529 | mxl1x1sf_demod_get_tps_guard_interval(state, | 528 | mxl1x1sf_demod_get_tps_guard_interval(state, |
530 | &p->u.ofdm.guard_interval); | 529 | &p->guard_interval); |
531 | mxl1x1sf_demod_get_tps_hierarchy(state, | 530 | mxl1x1sf_demod_get_tps_hierarchy(state, |
532 | &p->u.ofdm.hierarchy_information); | 531 | &p->hierarchy); |
533 | 532 | ||
534 | return 0; | 533 | return 0; |
535 | } | 534 | } |
@@ -551,7 +550,7 @@ static void mxl111sf_demod_release(struct dvb_frontend *fe) | |||
551 | } | 550 | } |
552 | 551 | ||
553 | static struct dvb_frontend_ops mxl111sf_demod_ops = { | 552 | static struct dvb_frontend_ops mxl111sf_demod_ops = { |
554 | 553 | .delsys = { SYS_DVBT }, | |
555 | .info = { | 554 | .info = { |
556 | .name = "MaxLinear MxL111SF DVB-T demodulator", | 555 | .name = "MaxLinear MxL111SF DVB-T demodulator", |
557 | .type = FE_OFDM, | 556 | .type = FE_OFDM, |
@@ -570,8 +569,8 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = { | |||
570 | .init = mxl111sf_init, | 569 | .init = mxl111sf_init, |
571 | .i2c_gate_ctrl = mxl111sf_i2c_gate_ctrl, | 570 | .i2c_gate_ctrl = mxl111sf_i2c_gate_ctrl, |
572 | #endif | 571 | #endif |
573 | .set_frontend_legacy = mxl111sf_demod_set_frontend, | 572 | .set_frontend = mxl111sf_demod_set_frontend, |
574 | .get_frontend_legacy = mxl111sf_demod_get_frontend, | 573 | .get_frontend = mxl111sf_demod_get_frontend, |
575 | .get_tune_settings = mxl111sf_demod_get_tune_settings, | 574 | .get_tune_settings = mxl111sf_demod_get_tune_settings, |
576 | .read_status = mxl111sf_demod_read_status, | 575 | .read_status = mxl111sf_demod_read_status, |
577 | .read_signal_strength = mxl111sf_demod_read_signal_strength, | 576 | .read_signal_strength = mxl111sf_demod_read_signal_strength, |