diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 12:44:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 06:42:19 -0500 |
commit | 787d92e176943913d7583f0f04e6d89a0014c5b4 (patch) | |
tree | 6447c2970ef010c31333db3c4e71524499de7ad9 /drivers | |
parent | 7826bcd58427878654d42e84f795e7f7d42ed1f1 (diff) |
[media] tda10023: 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/tda10023.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/drivers/media/dvb/frontends/tda10023.c b/drivers/media/dvb/frontends/tda10023.c index de535a4d4ac1..2766b6435ac9 100644 --- a/drivers/media/dvb/frontends/tda10023.c +++ b/drivers/media/dvb/frontends/tda10023.c | |||
@@ -302,8 +302,7 @@ struct qam_params { | |||
302 | u8 qam, lockthr, mseth, aref, agcrefnyq, eragnyq_thd; | 302 | u8 qam, lockthr, mseth, aref, agcrefnyq, eragnyq_thd; |
303 | }; | 303 | }; |
304 | 304 | ||
305 | static int tda10023_set_parameters (struct dvb_frontend *fe, | 305 | static int tda10023_set_parameters(struct dvb_frontend *fe) |
306 | struct dvb_frontend_parameters *p) | ||
307 | { | 306 | { |
308 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | 307 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; |
309 | u32 delsys = c->delivery_system; | 308 | u32 delsys = c->delivery_system; |
@@ -377,21 +376,6 @@ static int tda10023_set_parameters (struct dvb_frontend *fe, | |||
377 | return 0; | 376 | return 0; |
378 | } | 377 | } |
379 | 378 | ||
380 | static int tda10023_get_property(struct dvb_frontend *fe, | ||
381 | struct dtv_property *p) | ||
382 | { | ||
383 | switch (p->cmd) { | ||
384 | case DTV_ENUM_DELSYS: | ||
385 | p->u.buffer.data[0] = SYS_DVBC_ANNEX_A; | ||
386 | p->u.buffer.data[1] = SYS_DVBC_ANNEX_C; | ||
387 | p->u.buffer.len = 2; | ||
388 | break; | ||
389 | default: | ||
390 | break; | ||
391 | } | ||
392 | return 0; | ||
393 | } | ||
394 | |||
395 | static int tda10023_read_status(struct dvb_frontend* fe, fe_status_t* status) | 379 | static int tda10023_read_status(struct dvb_frontend* fe, fe_status_t* status) |
396 | { | 380 | { |
397 | struct tda10023_state* state = fe->demodulator_priv; | 381 | struct tda10023_state* state = fe->demodulator_priv; |
@@ -472,7 +456,7 @@ static int tda10023_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
472 | return 0; | 456 | return 0; |
473 | } | 457 | } |
474 | 458 | ||
475 | static int tda10023_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 459 | static int tda10023_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *p) |
476 | { | 460 | { |
477 | struct tda10023_state* state = fe->demodulator_priv; | 461 | struct tda10023_state* state = fe->demodulator_priv; |
478 | int sync,inv; | 462 | int sync,inv; |
@@ -487,17 +471,17 @@ static int tda10023_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
487 | printk(sync & 2 ? "DVB: TDA10023(%d): AFC (%d) %dHz\n" : | 471 | printk(sync & 2 ? "DVB: TDA10023(%d): AFC (%d) %dHz\n" : |
488 | "DVB: TDA10023(%d): [AFC (%d) %dHz]\n", | 472 | "DVB: TDA10023(%d): [AFC (%d) %dHz]\n", |
489 | state->frontend.dvb->num, afc, | 473 | state->frontend.dvb->num, afc, |
490 | -((s32)p->u.qam.symbol_rate * afc) >> 10); | 474 | -((s32)p->symbol_rate * afc) >> 10); |
491 | } | 475 | } |
492 | 476 | ||
493 | p->inversion = (inv&0x20?0:1); | 477 | p->inversion = (inv&0x20?0:1); |
494 | p->u.qam.modulation = ((state->reg0 >> 2) & 7) + QAM_16; | 478 | p->modulation = ((state->reg0 >> 2) & 7) + QAM_16; |
495 | 479 | ||
496 | p->u.qam.fec_inner = FEC_NONE; | 480 | p->fec_inner = FEC_NONE; |
497 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; | 481 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; |
498 | 482 | ||
499 | if (sync & 2) | 483 | if (sync & 2) |
500 | p->frequency -= ((s32)p->u.qam.symbol_rate * afc) >> 10; | 484 | p->frequency -= ((s32)p->symbol_rate * afc) >> 10; |
501 | 485 | ||
502 | return 0; | 486 | return 0; |
503 | } | 487 | } |
@@ -588,7 +572,7 @@ error: | |||
588 | } | 572 | } |
589 | 573 | ||
590 | static struct dvb_frontend_ops tda10023_ops = { | 574 | static struct dvb_frontend_ops tda10023_ops = { |
591 | 575 | .delsys = { SYS_DVBC_ANNEX_A, SYS_DVBC_ANNEX_C }, | |
592 | .info = { | 576 | .info = { |
593 | .name = "Philips TDA10023 DVB-C", | 577 | .name = "Philips TDA10023 DVB-C", |
594 | .type = FE_QAM, | 578 | .type = FE_QAM, |
@@ -609,9 +593,8 @@ static struct dvb_frontend_ops tda10023_ops = { | |||
609 | .sleep = tda10023_sleep, | 593 | .sleep = tda10023_sleep, |
610 | .i2c_gate_ctrl = tda10023_i2c_gate_ctrl, | 594 | .i2c_gate_ctrl = tda10023_i2c_gate_ctrl, |
611 | 595 | ||
612 | .set_frontend_legacy = tda10023_set_parameters, | 596 | .set_frontend = tda10023_set_parameters, |
613 | .get_frontend_legacy = tda10023_get_frontend, | 597 | .get_frontend = tda10023_get_frontend, |
614 | .get_property = tda10023_get_property, | ||
615 | .read_status = tda10023_read_status, | 598 | .read_status = tda10023_read_status, |
616 | .read_ber = tda10023_read_ber, | 599 | .read_ber = tda10023_read_ber, |
617 | .read_signal_strength = tda10023_read_signal_strength, | 600 | .read_signal_strength = tda10023_read_signal_strength, |