diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-04 13:15:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-07 08:59:00 -0400 |
commit | ecc31d557e0b5fd44d68733188290f4fa56d7db8 (patch) | |
tree | 9795e452467c7d58d15cbb1dd2f2360604d1ffad /drivers/media/dvb-frontends/dib8000.c | |
parent | a768f90ef0a214de2dfcce5ebf2bed93b2c4c015 (diff) |
[media] dib8000: improve debug messages
When debug is enabled:
- Report when frontend gets restarted;
- Be coherent on the displayed lines;
- Show the transmission mode;
- Hide unused layers.
No functional changes (except at the printk's).
Acked-By: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/dib8000.c')
-rw-r--r-- | drivers/media/dvb-frontends/dib8000.c | 64 |
1 files changed, 44 insertions, 20 deletions
diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index 637e96adf7c7..62214826e115 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c | |||
@@ -3391,7 +3391,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe) | |||
3391 | if (!(stat & FE_HAS_SYNC)) | 3391 | if (!(stat & FE_HAS_SYNC)) |
3392 | return 0; | 3392 | return 0; |
3393 | 3393 | ||
3394 | dprintk("TMCC lock"); | 3394 | dprintk("dib8000_get_frontend: TMCC lock"); |
3395 | for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { | 3395 | for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { |
3396 | state->fe[index_frontend]->ops.read_status(state->fe[index_frontend], &stat); | 3396 | state->fe[index_frontend]->ops.read_status(state->fe[index_frontend], &stat); |
3397 | if (stat&FE_HAS_SYNC) { | 3397 | if (stat&FE_HAS_SYNC) { |
@@ -3427,94 +3427,117 @@ static int dib8000_get_frontend(struct dvb_frontend *fe) | |||
3427 | switch ((val & 0x30) >> 4) { | 3427 | switch ((val & 0x30) >> 4) { |
3428 | case 1: | 3428 | case 1: |
3429 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_2K; | 3429 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_2K; |
3430 | dprintk("dib8000_get_frontend: transmission mode 2K"); | ||
3430 | break; | 3431 | break; |
3431 | case 2: | 3432 | case 2: |
3432 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_4K; | 3433 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_4K; |
3434 | dprintk("dib8000_get_frontend: transmission mode 4K"); | ||
3433 | break; | 3435 | break; |
3434 | case 3: | 3436 | case 3: |
3435 | default: | 3437 | default: |
3436 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_8K; | 3438 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_8K; |
3439 | dprintk("dib8000_get_frontend: transmission mode 8K"); | ||
3437 | break; | 3440 | break; |
3438 | } | 3441 | } |
3439 | 3442 | ||
3440 | switch (val & 0x3) { | 3443 | switch (val & 0x3) { |
3441 | case 0: | 3444 | case 0: |
3442 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_32; | 3445 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_32; |
3443 | dprintk("dib8000_get_frontend GI = 1/32 "); | 3446 | dprintk("dib8000_get_frontend: Guard Interval = 1/32 "); |
3444 | break; | 3447 | break; |
3445 | case 1: | 3448 | case 1: |
3446 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_16; | 3449 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_16; |
3447 | dprintk("dib8000_get_frontend GI = 1/16 "); | 3450 | dprintk("dib8000_get_frontend: Guard Interval = 1/16 "); |
3448 | break; | 3451 | break; |
3449 | case 2: | 3452 | case 2: |
3450 | dprintk("dib8000_get_frontend GI = 1/8 "); | 3453 | dprintk("dib8000_get_frontend: Guard Interval = 1/8 "); |
3451 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_8; | 3454 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_8; |
3452 | break; | 3455 | break; |
3453 | case 3: | 3456 | case 3: |
3454 | dprintk("dib8000_get_frontend GI = 1/4 "); | 3457 | dprintk("dib8000_get_frontend: Guard Interval = 1/4 "); |
3455 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_4; | 3458 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_4; |
3456 | break; | 3459 | break; |
3457 | } | 3460 | } |
3458 | 3461 | ||
3459 | val = dib8000_read_word(state, 505); | 3462 | val = dib8000_read_word(state, 505); |
3460 | fe->dtv_property_cache.isdbt_partial_reception = val & 1; | 3463 | fe->dtv_property_cache.isdbt_partial_reception = val & 1; |
3461 | dprintk("dib8000_get_frontend : partial_reception = %d ", fe->dtv_property_cache.isdbt_partial_reception); | 3464 | dprintk("dib8000_get_frontend: partial_reception = %d ", fe->dtv_property_cache.isdbt_partial_reception); |
3462 | 3465 | ||
3463 | for (i = 0; i < 3; i++) { | 3466 | for (i = 0; i < 3; i++) { |
3464 | val = dib8000_read_word(state, 493 + i); | 3467 | int show; |
3465 | fe->dtv_property_cache.layer[i].segment_count = val & 0x0F; | 3468 | |
3466 | dprintk("dib8000_get_frontend : Layer %d segments = %d ", i, fe->dtv_property_cache.layer[i].segment_count); | 3469 | val = dib8000_read_word(state, 493 + i) & 0x0f; |
3470 | fe->dtv_property_cache.layer[i].segment_count = val; | ||
3471 | |||
3472 | if (val == 0 || val > 13) | ||
3473 | show = 0; | ||
3474 | else | ||
3475 | show = 1; | ||
3476 | |||
3477 | if (show) | ||
3478 | dprintk("dib8000_get_frontend: Layer %d segments = %d ", | ||
3479 | i, fe->dtv_property_cache.layer[i].segment_count); | ||
3467 | 3480 | ||
3468 | val = dib8000_read_word(state, 499 + i) & 0x3; | 3481 | val = dib8000_read_word(state, 499 + i) & 0x3; |
3469 | /* Interleaving can be 0, 1, 2 or 4 */ | 3482 | /* Interleaving can be 0, 1, 2 or 4 */ |
3470 | if (val == 3) | 3483 | if (val == 3) |
3471 | val = 4; | 3484 | val = 4; |
3472 | fe->dtv_property_cache.layer[i].interleaving = val; | 3485 | fe->dtv_property_cache.layer[i].interleaving = val; |
3473 | dprintk("dib8000_get_frontend : Layer %d time_intlv = %d ", | 3486 | if (show) |
3474 | i, fe->dtv_property_cache.layer[i].interleaving); | 3487 | dprintk("dib8000_get_frontend: Layer %d time_intlv = %d ", |
3488 | i, fe->dtv_property_cache.layer[i].interleaving); | ||
3475 | 3489 | ||
3476 | val = dib8000_read_word(state, 481 + i); | 3490 | val = dib8000_read_word(state, 481 + i); |
3477 | switch (val & 0x7) { | 3491 | switch (val & 0x7) { |
3478 | case 1: | 3492 | case 1: |
3479 | fe->dtv_property_cache.layer[i].fec = FEC_1_2; | 3493 | fe->dtv_property_cache.layer[i].fec = FEC_1_2; |
3480 | dprintk("dib8000_get_frontend : Layer %d Code Rate = 1/2 ", i); | 3494 | if (show) |
3495 | dprintk("dib8000_get_frontend: Layer %d Code Rate = 1/2 ", i); | ||
3481 | break; | 3496 | break; |
3482 | case 2: | 3497 | case 2: |
3483 | fe->dtv_property_cache.layer[i].fec = FEC_2_3; | 3498 | fe->dtv_property_cache.layer[i].fec = FEC_2_3; |
3484 | dprintk("dib8000_get_frontend : Layer %d Code Rate = 2/3 ", i); | 3499 | if (show) |
3500 | dprintk("dib8000_get_frontend: Layer %d Code Rate = 2/3 ", i); | ||
3485 | break; | 3501 | break; |
3486 | case 3: | 3502 | case 3: |
3487 | fe->dtv_property_cache.layer[i].fec = FEC_3_4; | 3503 | fe->dtv_property_cache.layer[i].fec = FEC_3_4; |
3488 | dprintk("dib8000_get_frontend : Layer %d Code Rate = 3/4 ", i); | 3504 | if (show) |
3505 | dprintk("dib8000_get_frontend: Layer %d Code Rate = 3/4 ", i); | ||
3489 | break; | 3506 | break; |
3490 | case 5: | 3507 | case 5: |
3491 | fe->dtv_property_cache.layer[i].fec = FEC_5_6; | 3508 | fe->dtv_property_cache.layer[i].fec = FEC_5_6; |
3492 | dprintk("dib8000_get_frontend : Layer %d Code Rate = 5/6 ", i); | 3509 | if (show) |
3510 | dprintk("dib8000_get_frontend: Layer %d Code Rate = 5/6 ", i); | ||
3493 | break; | 3511 | break; |
3494 | default: | 3512 | default: |
3495 | fe->dtv_property_cache.layer[i].fec = FEC_7_8; | 3513 | fe->dtv_property_cache.layer[i].fec = FEC_7_8; |
3496 | dprintk("dib8000_get_frontend : Layer %d Code Rate = 7/8 ", i); | 3514 | if (show) |
3515 | dprintk("dib8000_get_frontend: Layer %d Code Rate = 7/8 ", i); | ||
3497 | break; | 3516 | break; |
3498 | } | 3517 | } |
3499 | 3518 | ||
3500 | val = dib8000_read_word(state, 487 + i); | 3519 | val = dib8000_read_word(state, 487 + i); |
3501 | switch (val & 0x3) { | 3520 | switch (val & 0x3) { |
3502 | case 0: | 3521 | case 0: |
3503 | dprintk("dib8000_get_frontend : Layer %d DQPSK ", i); | ||
3504 | fe->dtv_property_cache.layer[i].modulation = DQPSK; | 3522 | fe->dtv_property_cache.layer[i].modulation = DQPSK; |
3523 | if (show) | ||
3524 | dprintk("dib8000_get_frontend: Layer %d DQPSK ", i); | ||
3505 | break; | 3525 | break; |
3506 | case 1: | 3526 | case 1: |
3507 | fe->dtv_property_cache.layer[i].modulation = QPSK; | 3527 | fe->dtv_property_cache.layer[i].modulation = QPSK; |
3508 | dprintk("dib8000_get_frontend : Layer %d QPSK ", i); | 3528 | if (show) |
3529 | dprintk("dib8000_get_frontend: Layer %d QPSK ", i); | ||
3509 | break; | 3530 | break; |
3510 | case 2: | 3531 | case 2: |
3511 | fe->dtv_property_cache.layer[i].modulation = QAM_16; | 3532 | fe->dtv_property_cache.layer[i].modulation = QAM_16; |
3512 | dprintk("dib8000_get_frontend : Layer %d QAM16 ", i); | 3533 | if (show) |
3534 | dprintk("dib8000_get_frontend: Layer %d QAM16 ", i); | ||
3513 | break; | 3535 | break; |
3514 | case 3: | 3536 | case 3: |
3515 | default: | 3537 | default: |
3516 | dprintk("dib8000_get_frontend : Layer %d QAM64 ", i); | ||
3517 | fe->dtv_property_cache.layer[i].modulation = QAM_64; | 3538 | fe->dtv_property_cache.layer[i].modulation = QAM_64; |
3539 | if (show) | ||
3540 | dprintk("dib8000_get_frontend: Layer %d QAM64 ", i); | ||
3518 | break; | 3541 | break; |
3519 | } | 3542 | } |
3520 | } | 3543 | } |
@@ -3644,6 +3667,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe) | |||
3644 | 3667 | ||
3645 | for (l = 0; (l < MAX_NUMBER_OF_FRONTENDS) && (state->fe[l] != NULL); l++) { | 3668 | for (l = 0; (l < MAX_NUMBER_OF_FRONTENDS) && (state->fe[l] != NULL); l++) { |
3646 | if (l != index_frontend) { /* and for all frontend except the successful one */ | 3669 | if (l != index_frontend) { /* and for all frontend except the successful one */ |
3670 | dprintk("Restarting frontend %d\n", l); | ||
3647 | dib8000_tune_restart_from_demod(state->fe[l]); | 3671 | dib8000_tune_restart_from_demod(state->fe[l]); |
3648 | 3672 | ||
3649 | state->fe[l]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode; | 3673 | state->fe[l]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode; |