diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 10:26:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 06:30:51 -0500 |
commit | 80b5b7459de18a3038486eda61d74785634feea3 (patch) | |
tree | e547f75f8900cad79dfe5d31aad579925dc91db5 /drivers | |
parent | cf45787ced807791fc02ba9477b1bb320dd14801 (diff) |
[media] nxt6000: 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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/nxt6000.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c index a2419e86f34a..89021bddfcb6 100644 --- a/drivers/media/dvb/frontends/nxt6000.c +++ b/drivers/media/dvb/frontends/nxt6000.c | |||
@@ -81,22 +81,21 @@ static void nxt6000_reset(struct nxt6000_state* state) | |||
81 | nxt6000_writereg(state, OFDM_COR_CTL, val | COREACT); | 81 | nxt6000_writereg(state, OFDM_COR_CTL, val | COREACT); |
82 | } | 82 | } |
83 | 83 | ||
84 | static int nxt6000_set_bandwidth(struct nxt6000_state* state, fe_bandwidth_t bandwidth) | 84 | static int nxt6000_set_bandwidth(struct nxt6000_state *state, u32 bandwidth) |
85 | { | 85 | { |
86 | u16 nominal_rate; | 86 | u16 nominal_rate; |
87 | int result; | 87 | int result; |
88 | 88 | ||
89 | switch (bandwidth) { | 89 | switch (bandwidth) { |
90 | 90 | case 6000000: | |
91 | case BANDWIDTH_6_MHZ: | ||
92 | nominal_rate = 0x55B7; | 91 | nominal_rate = 0x55B7; |
93 | break; | 92 | break; |
94 | 93 | ||
95 | case BANDWIDTH_7_MHZ: | 94 | case 7000000: |
96 | nominal_rate = 0x6400; | 95 | nominal_rate = 0x6400; |
97 | break; | 96 | break; |
98 | 97 | ||
99 | case BANDWIDTH_8_MHZ: | 98 | case 8000000: |
100 | nominal_rate = 0x7249; | 99 | nominal_rate = 0x7249; |
101 | break; | 100 | break; |
102 | 101 | ||
@@ -457,8 +456,9 @@ static int nxt6000_init(struct dvb_frontend* fe) | |||
457 | return 0; | 456 | return 0; |
458 | } | 457 | } |
459 | 458 | ||
460 | static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) | 459 | static int nxt6000_set_frontend(struct dvb_frontend *fe) |
461 | { | 460 | { |
461 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; | ||
462 | struct nxt6000_state* state = fe->demodulator_priv; | 462 | struct nxt6000_state* state = fe->demodulator_priv; |
463 | int result; | 463 | int result; |
464 | 464 | ||
@@ -467,13 +467,20 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
467 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); | 467 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
468 | } | 468 | } |
469 | 469 | ||
470 | if ((result = nxt6000_set_bandwidth(state, param->u.ofdm.bandwidth)) < 0) | 470 | result = nxt6000_set_bandwidth(state, p->bandwidth_hz); |
471 | if (result < 0) | ||
471 | return result; | 472 | return result; |
472 | if ((result = nxt6000_set_guard_interval(state, param->u.ofdm.guard_interval)) < 0) | 473 | |
474 | result = nxt6000_set_guard_interval(state, p->guard_interval); | ||
475 | if (result < 0) | ||
473 | return result; | 476 | return result; |
474 | if ((result = nxt6000_set_transmission_mode(state, param->u.ofdm.transmission_mode)) < 0) | 477 | |
478 | result = nxt6000_set_transmission_mode(state, p->transmission_mode); | ||
479 | if (result < 0) | ||
475 | return result; | 480 | return result; |
476 | if ((result = nxt6000_set_inversion(state, param->inversion)) < 0) | 481 | |
482 | result = nxt6000_set_inversion(state, p->inversion); | ||
483 | if (result < 0) | ||
477 | return result; | 484 | return result; |
478 | 485 | ||
479 | msleep(500); | 486 | msleep(500); |
@@ -566,7 +573,7 @@ error: | |||
566 | } | 573 | } |
567 | 574 | ||
568 | static struct dvb_frontend_ops nxt6000_ops = { | 575 | static struct dvb_frontend_ops nxt6000_ops = { |
569 | 576 | .delsys = { SYS_DVBT }, | |
570 | .info = { | 577 | .info = { |
571 | .name = "NxtWave NXT6000 DVB-T", | 578 | .name = "NxtWave NXT6000 DVB-T", |
572 | .type = FE_OFDM, | 579 | .type = FE_OFDM, |
@@ -592,7 +599,7 @@ static struct dvb_frontend_ops nxt6000_ops = { | |||
592 | 599 | ||
593 | .get_tune_settings = nxt6000_fe_get_tune_settings, | 600 | .get_tune_settings = nxt6000_fe_get_tune_settings, |
594 | 601 | ||
595 | .set_frontend_legacy = nxt6000_set_frontend, | 602 | .set_frontend = nxt6000_set_frontend, |
596 | 603 | ||
597 | .read_status = nxt6000_read_status, | 604 | .read_status = nxt6000_read_status, |
598 | .read_ber = nxt6000_read_ber, | 605 | .read_ber = nxt6000_read_ber, |