Lines Matching full:layer
377 unsigned layer) in mb86a20s_get_modulation() argument
381 [0] = 0x86, /* Layer A */ in mb86a20s_get_modulation()
382 [1] = 0x8a, /* Layer B */ in mb86a20s_get_modulation()
383 [2] = 0x8e, /* Layer C */ in mb86a20s_get_modulation()
386 if (layer >= ARRAY_SIZE(reg)) in mb86a20s_get_modulation()
388 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_modulation()
409 unsigned layer) in mb86a20s_get_fec() argument
414 [0] = 0x87, /* Layer A */ in mb86a20s_get_fec()
415 [1] = 0x8b, /* Layer B */ in mb86a20s_get_fec()
416 [2] = 0x8f, /* Layer C */ in mb86a20s_get_fec()
419 if (layer >= ARRAY_SIZE(reg)) in mb86a20s_get_fec()
421 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_fec()
444 unsigned layer) in mb86a20s_get_interleaving() argument
452 [0] = 0x88, /* Layer A */ in mb86a20s_get_interleaving()
453 [1] = 0x8c, /* Layer B */ in mb86a20s_get_interleaving()
454 [2] = 0x90, /* Layer C */ in mb86a20s_get_interleaving()
457 if (layer >= ARRAY_SIZE(reg)) in mb86a20s_get_interleaving()
459 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_interleaving()
470 unsigned layer) in mb86a20s_get_segment_count() argument
474 [0] = 0x89, /* Layer A */ in mb86a20s_get_segment_count()
475 [1] = 0x8d, /* Layer B */ in mb86a20s_get_segment_count()
476 [2] = 0x91, /* Layer C */ in mb86a20s_get_segment_count()
481 if (layer >= ARRAY_SIZE(reg)) in mb86a20s_get_segment_count()
484 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_segment_count()
543 u32 layer) in isdbt_layer_min_bitrate() argument
552 switch (c->layer[layer].modulation) { in isdbt_layer_min_bitrate()
566 switch (c->layer[layer].fec) { in isdbt_layer_min_bitrate()
602 return isdbt_rate[mod][fec][guard] * c->layer[layer].segment_count; in isdbt_layer_min_bitrate()
609 int layer, rc, rate, counter; in mb86a20s_get_frontend() local
625 /* Get per-layer data */ in mb86a20s_get_frontend()
627 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_frontend()
628 dev_dbg(&state->i2c->dev, "%s: getting data for layer %c.\n", in mb86a20s_get_frontend()
629 __func__, 'A' + layer); in mb86a20s_get_frontend()
631 rc = mb86a20s_get_segment_count(state, layer); in mb86a20s_get_frontend()
635 c->layer[layer].segment_count = rc; in mb86a20s_get_frontend()
637 c->layer[layer].segment_count = 0; in mb86a20s_get_frontend()
638 state->estimated_rate[layer] = 0; in mb86a20s_get_frontend()
641 c->isdbt_layer_enabled |= 1 << layer; in mb86a20s_get_frontend()
642 rc = mb86a20s_get_modulation(state, layer); in mb86a20s_get_frontend()
647 c->layer[layer].modulation = rc; in mb86a20s_get_frontend()
648 rc = mb86a20s_get_fec(state, layer); in mb86a20s_get_frontend()
653 c->layer[layer].fec = rc; in mb86a20s_get_frontend()
654 rc = mb86a20s_get_interleaving(state, layer); in mb86a20s_get_frontend()
659 c->layer[layer].interleaving = rc; in mb86a20s_get_frontend()
661 rate = isdbt_layer_min_bitrate(c, layer); in mb86a20s_get_frontend()
671 "%s: layer %c bitrate: %d kbps; counter = %d (0x%06x)\n", in mb86a20s_get_frontend()
672 __func__, 'A' + layer, rate / 1000, counter, counter); in mb86a20s_get_frontend()
674 state->estimated_rate[layer] = counter; in mb86a20s_get_frontend()
722 /* per-layer info is incomplete; discard all per-layer */ in mb86a20s_get_frontend()
793 unsigned layer, in mb86a20s_get_pre_ber() argument
801 if (layer >= NUM_LAYERS) in mb86a20s_get_pre_ber()
809 /* Check if data is available for that layer */ in mb86a20s_get_pre_ber()
810 if (!(rc & (1 << layer))) { in mb86a20s_get_pre_ber()
812 "%s: preBER for layer %c is not available yet.\n", in mb86a20s_get_pre_ber()
813 __func__, 'A' + layer); in mb86a20s_get_pre_ber()
818 rc = mb86a20s_readreg(state, 0x55 + layer * 3); in mb86a20s_get_pre_ber()
822 rc = mb86a20s_readreg(state, 0x56 + layer * 3); in mb86a20s_get_pre_ber()
826 rc = mb86a20s_readreg(state, 0x57 + layer * 3); in mb86a20s_get_pre_ber()
832 "%s: bit error before Viterbi for layer %c: %d.\n", in mb86a20s_get_pre_ber()
833 __func__, 'A' + layer, *error); in mb86a20s_get_pre_ber()
836 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3); in mb86a20s_get_pre_ber()
843 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3); in mb86a20s_get_pre_ber()
850 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3); in mb86a20s_get_pre_ber()
859 "%s: bit count before Viterbi for layer %c: %d.\n", in mb86a20s_get_pre_ber()
860 __func__, 'A' + layer, *count); in mb86a20s_get_pre_ber()
870 if (state->estimated_rate[layer] in mb86a20s_get_pre_ber()
871 && state->estimated_rate[layer] != *count) { in mb86a20s_get_pre_ber()
873 "%s: updating layer %c preBER counter to %d.\n", in mb86a20s_get_pre_ber()
874 __func__, 'A' + layer, state->estimated_rate[layer]); in mb86a20s_get_pre_ber()
879 /* Update counter for this layer */ in mb86a20s_get_pre_ber()
880 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3); in mb86a20s_get_pre_ber()
884 state->estimated_rate[layer] >> 16); in mb86a20s_get_pre_ber()
887 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3); in mb86a20s_get_pre_ber()
891 state->estimated_rate[layer] >> 8); in mb86a20s_get_pre_ber()
894 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3); in mb86a20s_get_pre_ber()
898 state->estimated_rate[layer]); in mb86a20s_get_pre_ber()
916 rc = mb86a20s_writereg(state, 0x53, val & ~(1 << layer)); in mb86a20s_get_pre_ber()
919 rc = mb86a20s_writereg(state, 0x53, val | (1 << layer)); in mb86a20s_get_pre_ber()
926 unsigned layer, in mb86a20s_get_post_ber() argument
935 if (layer >= NUM_LAYERS) in mb86a20s_get_post_ber()
943 /* Check if data is available for that layer */ in mb86a20s_get_post_ber()
944 if (!(rc & (1 << layer))) { in mb86a20s_get_post_ber()
946 "%s: post BER for layer %c is not available yet.\n", in mb86a20s_get_post_ber()
947 __func__, 'A' + layer); in mb86a20s_get_post_ber()
952 rc = mb86a20s_readreg(state, 0x64 + layer * 3); in mb86a20s_get_post_ber()
956 rc = mb86a20s_readreg(state, 0x65 + layer * 3); in mb86a20s_get_post_ber()
960 rc = mb86a20s_readreg(state, 0x66 + layer * 3); in mb86a20s_get_post_ber()
966 "%s: post bit error for layer %c: %d.\n", in mb86a20s_get_post_ber()
967 __func__, 'A' + layer, *error); in mb86a20s_get_post_ber()
970 rc = mb86a20s_writereg(state, 0x50, 0xdc + layer * 2); in mb86a20s_get_post_ber()
977 rc = mb86a20s_writereg(state, 0x50, 0xdd + layer * 2); in mb86a20s_get_post_ber()
987 "%s: post bit count for layer %c: %d.\n", in mb86a20s_get_post_ber()
988 __func__, 'A' + layer, *count); in mb86a20s_get_post_ber()
997 if (!state->estimated_rate[layer]) in mb86a20s_get_post_ber()
1000 collect_rate = state->estimated_rate[layer] / 204 / 8; in mb86a20s_get_post_ber()
1007 "%s: updating postBER counter on layer %c to %d.\n", in mb86a20s_get_post_ber()
1008 __func__, 'A' + layer, collect_rate); in mb86a20s_get_post_ber()
1013 /* Update counter for this layer */ in mb86a20s_get_post_ber()
1014 rc = mb86a20s_writereg(state, 0x50, 0xdc + layer * 2); in mb86a20s_get_post_ber()
1020 rc = mb86a20s_writereg(state, 0x50, 0xdd + layer * 2); in mb86a20s_get_post_ber()
1045 rc = mb86a20s_writereg(state, 0x5f, val & ~(1 << layer)); in mb86a20s_get_post_ber()
1048 rc = mb86a20s_writereg(state, 0x5f, val | (1 << layer)); in mb86a20s_get_post_ber()
1054 unsigned layer, in mb86a20s_get_blk_error() argument
1062 if (layer >= NUM_LAYERS) in mb86a20s_get_blk_error()
1073 /* Check if data is available for that layer */ in mb86a20s_get_blk_error()
1075 if (!(rc & (1 << layer))) { in mb86a20s_get_blk_error()
1077 "%s: block counts for layer %c aren't available yet.\n", in mb86a20s_get_blk_error()
1078 __func__, 'A' + layer); in mb86a20s_get_blk_error()
1083 rc = mb86a20s_writereg(state, 0x50, 0xb9 + layer * 2); in mb86a20s_get_blk_error()
1090 rc = mb86a20s_writereg(state, 0x50, 0xba + layer * 2); in mb86a20s_get_blk_error()
1097 dev_dbg(&state->i2c->dev, "%s: block error for layer %c: %d.\n", in mb86a20s_get_blk_error()
1098 __func__, 'A' + layer, *error); in mb86a20s_get_blk_error()
1101 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2); in mb86a20s_get_blk_error()
1108 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2); in mb86a20s_get_blk_error()
1117 "%s: block count for layer %c: %d.\n", in mb86a20s_get_blk_error()
1118 __func__, 'A' + layer, *count); in mb86a20s_get_blk_error()
1127 if (!state->estimated_rate[layer]) in mb86a20s_get_blk_error()
1130 collect_rate = state->estimated_rate[layer] / 204 / 8; in mb86a20s_get_blk_error()
1138 "%s: updating PER counter on layer %c to %d.\n", in mb86a20s_get_blk_error()
1139 __func__, 'A' + layer, collect_rate); in mb86a20s_get_blk_error()
1149 /* Update this layer's counter */ in mb86a20s_get_blk_error()
1150 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2); in mb86a20s_get_blk_error()
1156 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2); in mb86a20s_get_blk_error()
1192 rc = mb86a20s_writereg(state, 0x51, val | (1 << layer)); in mb86a20s_get_blk_error()
1195 rc = mb86a20s_writereg(state, 0x51, val & ~(1 << layer)); in mb86a20s_get_blk_error()
1427 int rc, val, layer; in mb86a20s_get_blk_error_layer_CNR() local
1449 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_blk_error_layer_CNR()
1450 if (!(c->isdbt_layer_enabled & (1 << layer))) { in mb86a20s_get_blk_error_layer_CNR()
1451 c->cnr.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_blk_error_layer_CNR()
1455 rc = mb86a20s_writereg(state, 0x50, 0x52 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1462 rc = mb86a20s_writereg(state, 0x50, 0x53 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1469 rc = mb86a20s_writereg(state, 0x50, 0x54 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1477 switch (c->layer[layer].modulation) { in mb86a20s_get_blk_error_layer_CNR()
1495 c->cnr.stat[1 + layer].scale = FE_SCALE_DECIBEL; in mb86a20s_get_blk_error_layer_CNR()
1496 c->cnr.stat[1 + layer].svalue = cnr; in mb86a20s_get_blk_error_layer_CNR()
1499 "%s: CNR for layer %c is %d.%03d dB (MER = %d).\n", in mb86a20s_get_blk_error_layer_CNR()
1500 __func__, 'A' + layer, cnr / 1000, cnr % 1000, mer); in mb86a20s_get_blk_error_layer_CNR()
1528 int layer; in mb86a20s_stats_not_ready() local
1537 /* Per-layer stats - 3 layers + global */ in mb86a20s_stats_not_ready()
1551 for (layer = 0; layer < NUM_LAYERS + 1; layer++) { in mb86a20s_stats_not_ready()
1552 c->cnr.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1553 c->pre_bit_error.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1554 c->pre_bit_count.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1555 c->post_bit_error.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1556 c->post_bit_count.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1557 c->block_error.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1558 c->block_count.stat[layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_stats_not_ready()
1566 int rc = 0, layer; in mb86a20s_get_stats() local
1579 /* Get per-layer stats */ in mb86a20s_get_stats()
1590 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_stats()
1591 if (c->isdbt_layer_enabled & (1 << layer)) { in mb86a20s_get_stats()
1593 rc = mb86a20s_get_pre_ber(fe, layer, in mb86a20s_get_stats()
1596 c->pre_bit_error.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1597 c->pre_bit_error.stat[1 + layer].uvalue += bit_error; in mb86a20s_get_stats()
1598 c->pre_bit_count.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1599 c->pre_bit_count.stat[1 + layer].uvalue += bit_count; in mb86a20s_get_stats()
1605 c->pre_bit_error.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1606 c->pre_bit_count.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1608 "%s: Can't get BER for layer %c (error %d).\n", in mb86a20s_get_stats()
1609 __func__, 'A' + layer, rc); in mb86a20s_get_stats()
1611 if (c->block_error.stat[1 + layer].scale != FE_SCALE_NOT_AVAILABLE) in mb86a20s_get_stats()
1615 rc = mb86a20s_get_post_ber(fe, layer, in mb86a20s_get_stats()
1618 c->post_bit_error.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1619 c->post_bit_error.stat[1 + layer].uvalue += bit_error; in mb86a20s_get_stats()
1620 c->post_bit_count.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1621 c->post_bit_count.stat[1 + layer].uvalue += bit_count; in mb86a20s_get_stats()
1627 c->post_bit_error.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1628 c->post_bit_count.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1630 "%s: Can't get BER for layer %c (error %d).\n", in mb86a20s_get_stats()
1631 __func__, 'A' + layer, rc); in mb86a20s_get_stats()
1633 if (c->block_error.stat[1 + layer].scale != FE_SCALE_NOT_AVAILABLE) in mb86a20s_get_stats()
1637 rc = mb86a20s_get_blk_error(fe, layer, in mb86a20s_get_stats()
1641 c->block_error.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1642 c->block_error.stat[1 + layer].uvalue += block_error; in mb86a20s_get_stats()
1643 c->block_count.stat[1 + layer].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1644 c->block_count.stat[1 + layer].uvalue += block_count; in mb86a20s_get_stats()
1650 c->block_error.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1651 c->block_count.stat[1 + layer].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1653 "%s: Can't get PER for layer %c (error %d).\n", in mb86a20s_get_stats()
1654 __func__, 'A' + layer, rc); in mb86a20s_get_stats()
1657 if (c->block_error.stat[1 + layer].scale != FE_SCALE_NOT_AVAILABLE) in mb86a20s_get_stats()
1661 t_pre_bit_error += c->pre_bit_error.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1662 t_pre_bit_count += c->pre_bit_count.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1665 t_post_bit_error += c->post_bit_error.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1666 t_post_bit_count += c->post_bit_count.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1669 t_block_error += c->block_error.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1670 t_block_count += c->block_count.stat[1 + layer].uvalue; in mb86a20s_get_stats()
1680 * At least one per-layer BER measure was read. We can now in mb86a20s_get_stats()
1701 * At least one per-layer BER measure was read. We can now in mb86a20s_get_stats()
1718 * At least one per-layer UCB measure was read. We can now in mb86a20s_get_stats()