Commit ecc31d55 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarPatrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent a768f90e
...@@ -3391,7 +3391,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe) ...@@ -3391,7 +3391,7 @@ static int dib8000_get_frontend(struct dvb_frontend *fe)
if (!(stat & FE_HAS_SYNC)) if (!(stat & FE_HAS_SYNC))
return 0; return 0;
dprintk("TMCC lock"); dprintk("dib8000_get_frontend: TMCC lock");
for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
state->fe[index_frontend]->ops.read_status(state->fe[index_frontend], &stat); state->fe[index_frontend]->ops.read_status(state->fe[index_frontend], &stat);
if (stat&FE_HAS_SYNC) { if (stat&FE_HAS_SYNC) {
...@@ -3427,94 +3427,117 @@ static int dib8000_get_frontend(struct dvb_frontend *fe) ...@@ -3427,94 +3427,117 @@ static int dib8000_get_frontend(struct dvb_frontend *fe)
switch ((val & 0x30) >> 4) { switch ((val & 0x30) >> 4) {
case 1: case 1:
fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_2K; fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_2K;
dprintk("dib8000_get_frontend: transmission mode 2K");
break; break;
case 2: case 2:
fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_4K; fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_4K;
dprintk("dib8000_get_frontend: transmission mode 4K");
break; break;
case 3: case 3:
default: default:
fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_8K; fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_8K;
dprintk("dib8000_get_frontend: transmission mode 8K");
break; break;
} }
switch (val & 0x3) { switch (val & 0x3) {
case 0: case 0:
fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_32; fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_32;
dprintk("dib8000_get_frontend GI = 1/32 "); dprintk("dib8000_get_frontend: Guard Interval = 1/32 ");
break; break;
case 1: case 1:
fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_16; fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_16;
dprintk("dib8000_get_frontend GI = 1/16 "); dprintk("dib8000_get_frontend: Guard Interval = 1/16 ");
break; break;
case 2: case 2:
dprintk("dib8000_get_frontend GI = 1/8 "); dprintk("dib8000_get_frontend: Guard Interval = 1/8 ");
fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_8; fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_8;
break; break;
case 3: case 3:
dprintk("dib8000_get_frontend GI = 1/4 "); dprintk("dib8000_get_frontend: Guard Interval = 1/4 ");
fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_4; fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_1_4;
break; break;
} }
val = dib8000_read_word(state, 505); val = dib8000_read_word(state, 505);
fe->dtv_property_cache.isdbt_partial_reception = val & 1; fe->dtv_property_cache.isdbt_partial_reception = val & 1;
dprintk("dib8000_get_frontend : partial_reception = %d ", fe->dtv_property_cache.isdbt_partial_reception); dprintk("dib8000_get_frontend: partial_reception = %d ", fe->dtv_property_cache.isdbt_partial_reception);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
val = dib8000_read_word(state, 493 + i); int show;
fe->dtv_property_cache.layer[i].segment_count = val & 0x0F;
dprintk("dib8000_get_frontend : Layer %d segments = %d ", i, fe->dtv_property_cache.layer[i].segment_count); val = dib8000_read_word(state, 493 + i) & 0x0f;
fe->dtv_property_cache.layer[i].segment_count = val;
if (val == 0 || val > 13)
show = 0;
else
show = 1;
if (show)
dprintk("dib8000_get_frontend: Layer %d segments = %d ",
i, fe->dtv_property_cache.layer[i].segment_count);
val = dib8000_read_word(state, 499 + i) & 0x3; val = dib8000_read_word(state, 499 + i) & 0x3;
/* Interleaving can be 0, 1, 2 or 4 */ /* Interleaving can be 0, 1, 2 or 4 */
if (val == 3) if (val == 3)
val = 4; val = 4;
fe->dtv_property_cache.layer[i].interleaving = val; fe->dtv_property_cache.layer[i].interleaving = val;
dprintk("dib8000_get_frontend : Layer %d time_intlv = %d ", if (show)
dprintk("dib8000_get_frontend: Layer %d time_intlv = %d ",
i, fe->dtv_property_cache.layer[i].interleaving); i, fe->dtv_property_cache.layer[i].interleaving);
val = dib8000_read_word(state, 481 + i); val = dib8000_read_word(state, 481 + i);
switch (val & 0x7) { switch (val & 0x7) {
case 1: case 1:
fe->dtv_property_cache.layer[i].fec = FEC_1_2; fe->dtv_property_cache.layer[i].fec = FEC_1_2;
dprintk("dib8000_get_frontend : Layer %d Code Rate = 1/2 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d Code Rate = 1/2 ", i);
break; break;
case 2: case 2:
fe->dtv_property_cache.layer[i].fec = FEC_2_3; fe->dtv_property_cache.layer[i].fec = FEC_2_3;
dprintk("dib8000_get_frontend : Layer %d Code Rate = 2/3 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d Code Rate = 2/3 ", i);
break; break;
case 3: case 3:
fe->dtv_property_cache.layer[i].fec = FEC_3_4; fe->dtv_property_cache.layer[i].fec = FEC_3_4;
dprintk("dib8000_get_frontend : Layer %d Code Rate = 3/4 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d Code Rate = 3/4 ", i);
break; break;
case 5: case 5:
fe->dtv_property_cache.layer[i].fec = FEC_5_6; fe->dtv_property_cache.layer[i].fec = FEC_5_6;
dprintk("dib8000_get_frontend : Layer %d Code Rate = 5/6 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d Code Rate = 5/6 ", i);
break; break;
default: default:
fe->dtv_property_cache.layer[i].fec = FEC_7_8; fe->dtv_property_cache.layer[i].fec = FEC_7_8;
dprintk("dib8000_get_frontend : Layer %d Code Rate = 7/8 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d Code Rate = 7/8 ", i);
break; break;
} }
val = dib8000_read_word(state, 487 + i); val = dib8000_read_word(state, 487 + i);
switch (val & 0x3) { switch (val & 0x3) {
case 0: case 0:
dprintk("dib8000_get_frontend : Layer %d DQPSK ", i);
fe->dtv_property_cache.layer[i].modulation = DQPSK; fe->dtv_property_cache.layer[i].modulation = DQPSK;
if (show)
dprintk("dib8000_get_frontend: Layer %d DQPSK ", i);
break; break;
case 1: case 1:
fe->dtv_property_cache.layer[i].modulation = QPSK; fe->dtv_property_cache.layer[i].modulation = QPSK;
dprintk("dib8000_get_frontend : Layer %d QPSK ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d QPSK ", i);
break; break;
case 2: case 2:
fe->dtv_property_cache.layer[i].modulation = QAM_16; fe->dtv_property_cache.layer[i].modulation = QAM_16;
dprintk("dib8000_get_frontend : Layer %d QAM16 ", i); if (show)
dprintk("dib8000_get_frontend: Layer %d QAM16 ", i);
break; break;
case 3: case 3:
default: default:
dprintk("dib8000_get_frontend : Layer %d QAM64 ", i);
fe->dtv_property_cache.layer[i].modulation = QAM_64; fe->dtv_property_cache.layer[i].modulation = QAM_64;
if (show)
dprintk("dib8000_get_frontend: Layer %d QAM64 ", i);
break; break;
} }
} }
...@@ -3644,6 +3667,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe) ...@@ -3644,6 +3667,7 @@ static int dib8000_set_frontend(struct dvb_frontend *fe)
for (l = 0; (l < MAX_NUMBER_OF_FRONTENDS) && (state->fe[l] != NULL); l++) { for (l = 0; (l < MAX_NUMBER_OF_FRONTENDS) && (state->fe[l] != NULL); l++) {
if (l != index_frontend) { /* and for all frontend except the successful one */ if (l != index_frontend) { /* and for all frontend except the successful one */
dprintk("Restarting frontend %d\n", l);
dib8000_tune_restart_from_demod(state->fe[l]); dib8000_tune_restart_from_demod(state->fe[l]);
state->fe[l]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode; state->fe[l]->dtv_property_cache.isdbt_sb_mode = state->fe[index_frontend]->dtv_property_cache.isdbt_sb_mode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment