aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda10086.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-26 12:51:41 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 06:43:10 -0500
commit6714049e04af727775600b28ee11cae05e37e4b7 (patch)
treec1d02ef1ee5200288a95a9cf1fe56ca1e8010556 /drivers/media/dvb/frontends/tda10086.c
parentb2a29b578d9c21b2e5c88020f830d3c42115c51d (diff)
[media] tda10086: 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/media/dvb/frontends/tda10086.c')
-rw-r--r--drivers/media/dvb/frontends/tda10086.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c
index 85011005724..d8c2eef6fac 100644
--- a/drivers/media/dvb/frontends/tda10086.c
+++ b/drivers/media/dvb/frontends/tda10086.c
@@ -267,7 +267,7 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic
267} 267}
268 268
269static int tda10086_set_inversion(struct tda10086_state *state, 269static int tda10086_set_inversion(struct tda10086_state *state,
270 struct dvb_frontend_parameters *fe_params) 270 struct dtv_frontend_properties *fe_params)
271{ 271{
272 u8 invval = 0x80; 272 u8 invval = 0x80;
273 273
@@ -292,7 +292,7 @@ static int tda10086_set_inversion(struct tda10086_state *state,
292} 292}
293 293
294static int tda10086_set_symbol_rate(struct tda10086_state *state, 294static int tda10086_set_symbol_rate(struct tda10086_state *state,
295 struct dvb_frontend_parameters *fe_params) 295 struct dtv_frontend_properties *fe_params)
296{ 296{
297 u8 dfn = 0; 297 u8 dfn = 0;
298 u8 afs = 0; 298 u8 afs = 0;
@@ -303,7 +303,7 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state,
303 u32 tmp; 303 u32 tmp;
304 u32 bdr; 304 u32 bdr;
305 u32 bdri; 305 u32 bdri;
306 u32 symbol_rate = fe_params->u.qpsk.symbol_rate; 306 u32 symbol_rate = fe_params->symbol_rate;
307 307
308 dprintk ("%s %i\n", __func__, symbol_rate); 308 dprintk ("%s %i\n", __func__, symbol_rate);
309 309
@@ -367,13 +367,13 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state,
367} 367}
368 368
369static int tda10086_set_fec(struct tda10086_state *state, 369static int tda10086_set_fec(struct tda10086_state *state,
370 struct dvb_frontend_parameters *fe_params) 370 struct dtv_frontend_properties *fe_params)
371{ 371{
372 u8 fecval; 372 u8 fecval;
373 373
374 dprintk ("%s %i\n", __func__, fe_params->u.qpsk.fec_inner); 374 dprintk("%s %i\n", __func__, fe_params->fec_inner);
375 375
376 switch(fe_params->u.qpsk.fec_inner) { 376 switch (fe_params->fec_inner) {
377 case FEC_1_2: 377 case FEC_1_2:
378 fecval = 0x00; 378 fecval = 0x00;
379 break; 379 break;
@@ -409,9 +409,9 @@ static int tda10086_set_fec(struct tda10086_state *state,
409 return 0; 409 return 0;
410} 410}
411 411
412static int tda10086_set_frontend(struct dvb_frontend* fe, 412static int tda10086_set_frontend(struct dvb_frontend *fe)
413 struct dvb_frontend_parameters *fe_params)
414{ 413{
414 struct dtv_frontend_properties *fe_params = &fe->dtv_property_cache;
415 struct tda10086_state *state = fe->demodulator_priv; 415 struct tda10086_state *state = fe->demodulator_priv;
416 int ret; 416 int ret;
417 u32 freq = 0; 417 u32 freq = 0;
@@ -452,12 +452,12 @@ static int tda10086_set_frontend(struct dvb_frontend* fe,
452 tda10086_write_mask(state, 0x10, 0x40, 0x40); 452 tda10086_write_mask(state, 0x10, 0x40, 0x40);
453 tda10086_write_mask(state, 0x00, 0x01, 0x00); 453 tda10086_write_mask(state, 0x00, 0x01, 0x00);
454 454
455 state->symbol_rate = fe_params->u.qpsk.symbol_rate; 455 state->symbol_rate = fe_params->symbol_rate;
456 state->frequency = fe_params->frequency; 456 state->frequency = fe_params->frequency;
457 return 0; 457 return 0;
458} 458}
459 459
460static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *fe_params) 460static int tda10086_get_frontend(struct dvb_frontend *fe, struct dtv_frontend_properties *fe_params)
461{ 461{
462 struct tda10086_state* state = fe->demodulator_priv; 462 struct tda10086_state* state = fe->demodulator_priv;
463 u8 val; 463 u8 val;
@@ -467,7 +467,7 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
467 dprintk ("%s\n", __func__); 467 dprintk ("%s\n", __func__);
468 468
469 /* check for invalid symbol rate */ 469 /* check for invalid symbol rate */
470 if (fe_params->u.qpsk.symbol_rate < 500000) 470 if (fe_params->symbol_rate < 500000)
471 return -EINVAL; 471 return -EINVAL;
472 472
473 /* calculate the updated frequency (note: we convert from Hz->kHz) */ 473 /* calculate the updated frequency (note: we convert from Hz->kHz) */
@@ -516,34 +516,34 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
516 tmp |= 0xffffff00; 516 tmp |= 0xffffff00;
517 tmp = (tmp * 480 * (1<<1)) / 128; 517 tmp = (tmp * 480 * (1<<1)) / 128;
518 tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000); 518 tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000);
519 fe_params->u.qpsk.symbol_rate = state->symbol_rate + tmp; 519 fe_params->symbol_rate = state->symbol_rate + tmp;
520 520
521 /* the FEC */ 521 /* the FEC */
522 val = (tda10086_read_byte(state, 0x0d) & 0x70) >> 4; 522 val = (tda10086_read_byte(state, 0x0d) & 0x70) >> 4;
523 switch(val) { 523 switch(val) {
524 case 0x00: 524 case 0x00:
525 fe_params->u.qpsk.fec_inner = FEC_1_2; 525 fe_params->fec_inner = FEC_1_2;
526 break; 526 break;
527 case 0x01: 527 case 0x01:
528 fe_params->u.qpsk.fec_inner = FEC_2_3; 528 fe_params->fec_inner = FEC_2_3;
529 break; 529 break;
530 case 0x02: 530 case 0x02:
531 fe_params->u.qpsk.fec_inner = FEC_3_4; 531 fe_params->fec_inner = FEC_3_4;
532 break; 532 break;
533 case 0x03: 533 case 0x03:
534 fe_params->u.qpsk.fec_inner = FEC_4_5; 534 fe_params->fec_inner = FEC_4_5;
535 break; 535 break;
536 case 0x04: 536 case 0x04:
537 fe_params->u.qpsk.fec_inner = FEC_5_6; 537 fe_params->fec_inner = FEC_5_6;
538 break; 538 break;
539 case 0x05: 539 case 0x05:
540 fe_params->u.qpsk.fec_inner = FEC_6_7; 540 fe_params->fec_inner = FEC_6_7;
541 break; 541 break;
542 case 0x06: 542 case 0x06:
543 fe_params->u.qpsk.fec_inner = FEC_7_8; 543 fe_params->fec_inner = FEC_7_8;
544 break; 544 break;
545 case 0x07: 545 case 0x07:
546 fe_params->u.qpsk.fec_inner = FEC_8_9; 546 fe_params->fec_inner = FEC_8_9;
547 break; 547 break;
548 } 548 }
549 549
@@ -701,7 +701,7 @@ static void tda10086_release(struct dvb_frontend* fe)
701} 701}
702 702
703static struct dvb_frontend_ops tda10086_ops = { 703static struct dvb_frontend_ops tda10086_ops = {
704 704 .delsys = { SYS_DVBS },
705 .info = { 705 .info = {
706 .name = "Philips TDA10086 DVB-S", 706 .name = "Philips TDA10086 DVB-S",
707 .type = FE_QPSK, 707 .type = FE_QPSK,
@@ -722,8 +722,8 @@ static struct dvb_frontend_ops tda10086_ops = {
722 .sleep = tda10086_sleep, 722 .sleep = tda10086_sleep,
723 .i2c_gate_ctrl = tda10086_i2c_gate_ctrl, 723 .i2c_gate_ctrl = tda10086_i2c_gate_ctrl,
724 724
725 .set_frontend_legacy = tda10086_set_frontend, 725 .set_frontend = tda10086_set_frontend,
726 .get_frontend_legacy = tda10086_get_frontend, 726 .get_frontend = tda10086_get_frontend,
727 .get_tune_settings = tda10086_get_tune_settings, 727 .get_tune_settings = tda10086_get_tune_settings,
728 728
729 .read_status = tda10086_read_status, 729 .read_status = tda10086_read_status,