aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/firewire/firedtv-avc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/firewire/firedtv-avc.c')
-rw-r--r--drivers/media/dvb/firewire/firedtv-avc.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-avc.c b/drivers/media/dvb/firewire/firedtv-avc.c
index 489ae824586..d1a1a1324ef 100644
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -335,7 +335,7 @@ static int add_pid_filter(struct firedtv *fdtv, u8 *operand)
335 * (not supported by the AVC standard) 335 * (not supported by the AVC standard)
336 */ 336 */
337static int avc_tuner_tuneqpsk(struct firedtv *fdtv, 337static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
338 struct dvb_frontend_parameters *params) 338 struct dtv_frontend_properties *p)
339{ 339{
340 struct avc_command_frame *c = (void *)fdtv->avc_data; 340 struct avc_command_frame *c = (void *)fdtv->avc_data;
341 341
@@ -349,15 +349,15 @@ static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
349 else 349 else
350 c->operand[3] = SFE_VENDOR_OPCODE_TUNE_QPSK; 350 c->operand[3] = SFE_VENDOR_OPCODE_TUNE_QPSK;
351 351
352 c->operand[4] = (params->frequency >> 24) & 0xff; 352 c->operand[4] = (p->frequency >> 24) & 0xff;
353 c->operand[5] = (params->frequency >> 16) & 0xff; 353 c->operand[5] = (p->frequency >> 16) & 0xff;
354 c->operand[6] = (params->frequency >> 8) & 0xff; 354 c->operand[6] = (p->frequency >> 8) & 0xff;
355 c->operand[7] = params->frequency & 0xff; 355 c->operand[7] = p->frequency & 0xff;
356 356
357 c->operand[8] = ((params->u.qpsk.symbol_rate / 1000) >> 8) & 0xff; 357 c->operand[8] = ((p->symbol_rate / 1000) >> 8) & 0xff;
358 c->operand[9] = (params->u.qpsk.symbol_rate / 1000) & 0xff; 358 c->operand[9] = (p->symbol_rate / 1000) & 0xff;
359 359
360 switch (params->u.qpsk.fec_inner) { 360 switch (p->fec_inner) {
361 case FEC_1_2: c->operand[10] = 0x1; break; 361 case FEC_1_2: c->operand[10] = 0x1; break;
362 case FEC_2_3: c->operand[10] = 0x2; break; 362 case FEC_2_3: c->operand[10] = 0x2; break;
363 case FEC_3_4: c->operand[10] = 0x3; break; 363 case FEC_3_4: c->operand[10] = 0x3; break;
@@ -392,10 +392,11 @@ static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
392 default: c->operand[13] = 0x2; break; 392 default: c->operand[13] = 0x2; break;
393 } 393 }
394 switch (fdtv->fe.dtv_property_cache.rolloff) { 394 switch (fdtv->fe.dtv_property_cache.rolloff) {
395 case ROLLOFF_AUTO: c->operand[14] = 0x2; break;
396 case ROLLOFF_35: c->operand[14] = 0x2; break; 395 case ROLLOFF_35: c->operand[14] = 0x2; break;
397 case ROLLOFF_20: c->operand[14] = 0x0; break; 396 case ROLLOFF_20: c->operand[14] = 0x0; break;
398 case ROLLOFF_25: c->operand[14] = 0x1; break; 397 case ROLLOFF_25: c->operand[14] = 0x1; break;
398 case ROLLOFF_AUTO:
399 default: c->operand[14] = 0x2; break;
399 /* case ROLLOFF_NONE: c->operand[14] = 0xff; break; */ 400 /* case ROLLOFF_NONE: c->operand[14] = 0xff; break; */
400 } 401 }
401 switch (fdtv->fe.dtv_property_cache.pilot) { 402 switch (fdtv->fe.dtv_property_cache.pilot) {
@@ -415,7 +416,7 @@ static int avc_tuner_tuneqpsk(struct firedtv *fdtv,
415} 416}
416 417
417static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv, 418static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
418 struct dvb_frontend_parameters *params) 419 struct dtv_frontend_properties *p)
419{ 420{
420 struct avc_command_frame *c = (void *)fdtv->avc_data; 421 struct avc_command_frame *c = (void *)fdtv->avc_data;
421 422
@@ -434,8 +435,8 @@ static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
434 | 1 << 4 /* Frequency */ 435 | 1 << 4 /* Frequency */
435 | 1 << 3 /* Symbol_Rate */ 436 | 1 << 3 /* Symbol_Rate */
436 | 0 << 2 /* FEC_outer */ 437 | 0 << 2 /* FEC_outer */
437 | (params->u.qam.fec_inner != FEC_AUTO ? 1 << 1 : 0) 438 | (p->fec_inner != FEC_AUTO ? 1 << 1 : 0)
438 | (params->u.qam.modulation != QAM_AUTO ? 1 << 0 : 0); 439 | (p->modulation != QAM_AUTO ? 1 << 0 : 0);
439 440
440 /* multiplex_valid_flags, low byte */ 441 /* multiplex_valid_flags, low byte */
441 c->operand[6] = 0 << 7 /* NetworkID */ 442 c->operand[6] = 0 << 7 /* NetworkID */
@@ -446,15 +447,15 @@ static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
446 c->operand[9] = 0x00; 447 c->operand[9] = 0x00;
447 c->operand[10] = 0x00; 448 c->operand[10] = 0x00;
448 449
449 c->operand[11] = (((params->frequency / 4000) >> 16) & 0xff) | (2 << 6); 450 c->operand[11] = (((p->frequency / 4000) >> 16) & 0xff) | (2 << 6);
450 c->operand[12] = ((params->frequency / 4000) >> 8) & 0xff; 451 c->operand[12] = ((p->frequency / 4000) >> 8) & 0xff;
451 c->operand[13] = (params->frequency / 4000) & 0xff; 452 c->operand[13] = (p->frequency / 4000) & 0xff;
452 c->operand[14] = ((params->u.qpsk.symbol_rate / 1000) >> 12) & 0xff; 453 c->operand[14] = ((p->symbol_rate / 1000) >> 12) & 0xff;
453 c->operand[15] = ((params->u.qpsk.symbol_rate / 1000) >> 4) & 0xff; 454 c->operand[15] = ((p->symbol_rate / 1000) >> 4) & 0xff;
454 c->operand[16] = ((params->u.qpsk.symbol_rate / 1000) << 4) & 0xf0; 455 c->operand[16] = ((p->symbol_rate / 1000) << 4) & 0xf0;
455 c->operand[17] = 0x00; 456 c->operand[17] = 0x00;
456 457
457 switch (params->u.qpsk.fec_inner) { 458 switch (p->fec_inner) {
458 case FEC_1_2: c->operand[18] = 0x1; break; 459 case FEC_1_2: c->operand[18] = 0x1; break;
459 case FEC_2_3: c->operand[18] = 0x2; break; 460 case FEC_2_3: c->operand[18] = 0x2; break;
460 case FEC_3_4: c->operand[18] = 0x3; break; 461 case FEC_3_4: c->operand[18] = 0x3; break;
@@ -466,7 +467,7 @@ static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
466 default: c->operand[18] = 0x0; 467 default: c->operand[18] = 0x0;
467 } 468 }
468 469
469 switch (params->u.qam.modulation) { 470 switch (p->modulation) {
470 case QAM_16: c->operand[19] = 0x08; break; 471 case QAM_16: c->operand[19] = 0x08; break;
471 case QAM_32: c->operand[19] = 0x10; break; 472 case QAM_32: c->operand[19] = 0x10; break;
472 case QAM_64: c->operand[19] = 0x18; break; 473 case QAM_64: c->operand[19] = 0x18; break;
@@ -483,9 +484,8 @@ static int avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
483} 484}
484 485
485static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv, 486static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
486 struct dvb_frontend_parameters *params) 487 struct dtv_frontend_properties *p)
487{ 488{
488 struct dvb_ofdm_parameters *ofdm = &params->u.ofdm;
489 struct avc_command_frame *c = (void *)fdtv->avc_data; 489 struct avc_command_frame *c = (void *)fdtv->avc_data;
490 490
491 c->opcode = AVC_OPCODE_DSD; 491 c->opcode = AVC_OPCODE_DSD;
@@ -500,42 +500,42 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
500 c->operand[5] = 500 c->operand[5] =
501 0 << 7 /* reserved */ 501 0 << 7 /* reserved */
502 | 1 << 6 /* CenterFrequency */ 502 | 1 << 6 /* CenterFrequency */
503 | (ofdm->bandwidth != BANDWIDTH_AUTO ? 1 << 5 : 0) 503 | (p->bandwidth_hz != 0 ? 1 << 5 : 0)
504 | (ofdm->constellation != QAM_AUTO ? 1 << 4 : 0) 504 | (p->modulation != QAM_AUTO ? 1 << 4 : 0)
505 | (ofdm->hierarchy_information != HIERARCHY_AUTO ? 1 << 3 : 0) 505 | (p->hierarchy != HIERARCHY_AUTO ? 1 << 3 : 0)
506 | (ofdm->code_rate_HP != FEC_AUTO ? 1 << 2 : 0) 506 | (p->code_rate_HP != FEC_AUTO ? 1 << 2 : 0)
507 | (ofdm->code_rate_LP != FEC_AUTO ? 1 << 1 : 0) 507 | (p->code_rate_LP != FEC_AUTO ? 1 << 1 : 0)
508 | (ofdm->guard_interval != GUARD_INTERVAL_AUTO ? 1 << 0 : 0); 508 | (p->guard_interval != GUARD_INTERVAL_AUTO ? 1 << 0 : 0);
509 509
510 /* multiplex_valid_flags, low byte */ 510 /* multiplex_valid_flags, low byte */
511 c->operand[6] = 511 c->operand[6] =
512 0 << 7 /* NetworkID */ 512 0 << 7 /* NetworkID */
513 | (ofdm->transmission_mode != TRANSMISSION_MODE_AUTO ? 1 << 6 : 0) 513 | (p->transmission_mode != TRANSMISSION_MODE_AUTO ? 1 << 6 : 0)
514 | 0 << 5 /* OtherFrequencyFlag */ 514 | 0 << 5 /* OtherFrequencyFlag */
515 | 0 << 0 /* reserved */ ; 515 | 0 << 0 /* reserved */ ;
516 516
517 c->operand[7] = 0x0; 517 c->operand[7] = 0x0;
518 c->operand[8] = (params->frequency / 10) >> 24; 518 c->operand[8] = (p->frequency / 10) >> 24;
519 c->operand[9] = ((params->frequency / 10) >> 16) & 0xff; 519 c->operand[9] = ((p->frequency / 10) >> 16) & 0xff;
520 c->operand[10] = ((params->frequency / 10) >> 8) & 0xff; 520 c->operand[10] = ((p->frequency / 10) >> 8) & 0xff;
521 c->operand[11] = (params->frequency / 10) & 0xff; 521 c->operand[11] = (p->frequency / 10) & 0xff;
522 522
523 switch (ofdm->bandwidth) { 523 switch (p->bandwidth_hz) {
524 case BANDWIDTH_7_MHZ: c->operand[12] = 0x20; break; 524 case 7000000: c->operand[12] = 0x20; break;
525 case BANDWIDTH_8_MHZ: 525 case 8000000:
526 case BANDWIDTH_6_MHZ: /* not defined by AVC spec */ 526 case 6000000: /* not defined by AVC spec */
527 case BANDWIDTH_AUTO: 527 case 0:
528 default: c->operand[12] = 0x00; 528 default: c->operand[12] = 0x00;
529 } 529 }
530 530
531 switch (ofdm->constellation) { 531 switch (p->modulation) {
532 case QAM_16: c->operand[13] = 1 << 6; break; 532 case QAM_16: c->operand[13] = 1 << 6; break;
533 case QAM_64: c->operand[13] = 2 << 6; break; 533 case QAM_64: c->operand[13] = 2 << 6; break;
534 case QPSK: 534 case QPSK:
535 default: c->operand[13] = 0x00; 535 default: c->operand[13] = 0x00;
536 } 536 }
537 537
538 switch (ofdm->hierarchy_information) { 538 switch (p->hierarchy) {
539 case HIERARCHY_1: c->operand[13] |= 1 << 3; break; 539 case HIERARCHY_1: c->operand[13] |= 1 << 3; break;
540 case HIERARCHY_2: c->operand[13] |= 2 << 3; break; 540 case HIERARCHY_2: c->operand[13] |= 2 << 3; break;
541 case HIERARCHY_4: c->operand[13] |= 3 << 3; break; 541 case HIERARCHY_4: c->operand[13] |= 3 << 3; break;
@@ -544,7 +544,7 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
544 default: break; 544 default: break;
545 } 545 }
546 546
547 switch (ofdm->code_rate_HP) { 547 switch (p->code_rate_HP) {
548 case FEC_2_3: c->operand[13] |= 1; break; 548 case FEC_2_3: c->operand[13] |= 1; break;
549 case FEC_3_4: c->operand[13] |= 2; break; 549 case FEC_3_4: c->operand[13] |= 2; break;
550 case FEC_5_6: c->operand[13] |= 3; break; 550 case FEC_5_6: c->operand[13] |= 3; break;
@@ -553,7 +553,7 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
553 default: break; 553 default: break;
554 } 554 }
555 555
556 switch (ofdm->code_rate_LP) { 556 switch (p->code_rate_LP) {
557 case FEC_2_3: c->operand[14] = 1 << 5; break; 557 case FEC_2_3: c->operand[14] = 1 << 5; break;
558 case FEC_3_4: c->operand[14] = 2 << 5; break; 558 case FEC_3_4: c->operand[14] = 2 << 5; break;
559 case FEC_5_6: c->operand[14] = 3 << 5; break; 559 case FEC_5_6: c->operand[14] = 3 << 5; break;
@@ -562,7 +562,7 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
562 default: c->operand[14] = 0x00; break; 562 default: c->operand[14] = 0x00; break;
563 } 563 }
564 564
565 switch (ofdm->guard_interval) { 565 switch (p->guard_interval) {
566 case GUARD_INTERVAL_1_16: c->operand[14] |= 1 << 3; break; 566 case GUARD_INTERVAL_1_16: c->operand[14] |= 1 << 3; break;
567 case GUARD_INTERVAL_1_8: c->operand[14] |= 2 << 3; break; 567 case GUARD_INTERVAL_1_8: c->operand[14] |= 2 << 3; break;
568 case GUARD_INTERVAL_1_4: c->operand[14] |= 3 << 3; break; 568 case GUARD_INTERVAL_1_4: c->operand[14] |= 3 << 3; break;
@@ -571,7 +571,7 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
571 default: break; 571 default: break;
572 } 572 }
573 573
574 switch (ofdm->transmission_mode) { 574 switch (p->transmission_mode) {
575 case TRANSMISSION_MODE_8K: c->operand[14] |= 1 << 1; break; 575 case TRANSMISSION_MODE_8K: c->operand[14] |= 1 << 1; break;
576 case TRANSMISSION_MODE_2K: 576 case TRANSMISSION_MODE_2K:
577 case TRANSMISSION_MODE_AUTO: 577 case TRANSMISSION_MODE_AUTO:
@@ -585,7 +585,7 @@ static int avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
585} 585}
586 586
587int avc_tuner_dsd(struct firedtv *fdtv, 587int avc_tuner_dsd(struct firedtv *fdtv,
588 struct dvb_frontend_parameters *params) 588 struct dtv_frontend_properties *p)
589{ 589{
590 struct avc_command_frame *c = (void *)fdtv->avc_data; 590 struct avc_command_frame *c = (void *)fdtv->avc_data;
591 int pos, ret; 591 int pos, ret;
@@ -597,9 +597,9 @@ int avc_tuner_dsd(struct firedtv *fdtv,
597 597
598 switch (fdtv->type) { 598 switch (fdtv->type) {
599 case FIREDTV_DVB_S: 599 case FIREDTV_DVB_S:
600 case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, params); break; 600 case FIREDTV_DVB_S2: pos = avc_tuner_tuneqpsk(fdtv, p); break;
601 case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, params); break; 601 case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, p); break;
602 case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, params); break; 602 case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, p); break;
603 default: 603 default:
604 BUG(); 604 BUG();
605 } 605 }