Lines Matching +full:0 +full:x29
18 MB86A20S_13SEG = 0,
25 0xb0, 0xc0, 0xd0, 0xe0,
26 0xf0, 0x00, 0x10, 0x20,
59 { 0x70, 0x0f },
60 { 0x70, 0xff },
61 { 0x08, 0x01 },
62 { 0x50, 0xd1 }, { 0x51, 0x20 },
66 { 0x50, 0xd1 }, { 0x51, 0x22 },
67 { 0x39, 0x01 },
68 { 0x71, 0x00 },
69 { 0x3b, 0x21 },
70 { 0x3c, 0x3a },
71 { 0x01, 0x0d },
72 { 0x04, 0x08 }, { 0x05, 0x05 },
73 { 0x04, 0x0e }, { 0x05, 0x00 },
74 { 0x04, 0x0f }, { 0x05, 0x14 },
75 { 0x04, 0x0b }, { 0x05, 0x8c },
76 { 0x04, 0x00 }, { 0x05, 0x00 },
77 { 0x04, 0x01 }, { 0x05, 0x07 },
78 { 0x04, 0x02 }, { 0x05, 0x0f },
79 { 0x04, 0x03 }, { 0x05, 0xa0 },
80 { 0x04, 0x09 }, { 0x05, 0x00 },
81 { 0x04, 0x0a }, { 0x05, 0xff },
82 { 0x04, 0x27 }, { 0x05, 0x64 },
83 { 0x04, 0x28 }, { 0x05, 0x00 },
84 { 0x04, 0x1e }, { 0x05, 0xff },
85 { 0x04, 0x29 }, { 0x05, 0x0a },
86 { 0x04, 0x32 }, { 0x05, 0x0a },
87 { 0x04, 0x14 }, { 0x05, 0x02 },
88 { 0x04, 0x04 }, { 0x05, 0x00 },
89 { 0x04, 0x05 }, { 0x05, 0x22 },
90 { 0x04, 0x06 }, { 0x05, 0x0e },
91 { 0x04, 0x07 }, { 0x05, 0xd8 },
92 { 0x04, 0x12 }, { 0x05, 0x00 },
93 { 0x04, 0x13 }, { 0x05, 0xff },
102 { 0x52, 0x01 }, /* Turn on BER before Viterbi */
103 { 0x50, 0xa7 }, { 0x51, 0x00 },
104 { 0x50, 0xa8 }, { 0x51, 0xff },
105 { 0x50, 0xa9 }, { 0x51, 0xff },
106 { 0x50, 0xaa }, { 0x51, 0x00 },
107 { 0x50, 0xab }, { 0x51, 0xff },
108 { 0x50, 0xac }, { 0x51, 0xff },
109 { 0x50, 0xad }, { 0x51, 0x00 },
110 { 0x50, 0xae }, { 0x51, 0xff },
111 { 0x50, 0xaf }, { 0x51, 0xff },
120 { 0x5e, 0x07 }, /* Turn on BER after Viterbi */
121 { 0x50, 0xdc }, { 0x51, 0x00 },
122 { 0x50, 0xdd }, { 0x51, 0x7f },
123 { 0x50, 0xde }, { 0x51, 0x00 },
124 { 0x50, 0xdf }, { 0x51, 0x7f },
125 { 0x50, 0xe0 }, { 0x51, 0x00 },
126 { 0x50, 0xe1 }, { 0x51, 0x7f },
135 { 0x50, 0xb0 }, { 0x51, 0x07 }, /* Enable PER */
136 { 0x50, 0xb2 }, { 0x51, 0x00 },
137 { 0x50, 0xb3 }, { 0x51, 0x7f },
138 { 0x50, 0xb4 }, { 0x51, 0x00 },
139 { 0x50, 0xb5 }, { 0x51, 0x7f },
140 { 0x50, 0xb6 }, { 0x51, 0x00 },
141 { 0x50, 0xb7 }, { 0x51, 0x7f },
143 { 0x50, 0x50 }, { 0x51, 0x02 }, /* MER manual mode */
144 { 0x50, 0x51 }, { 0x51, 0x04 }, /* MER symbol 4 */
145 { 0x45, 0x04 }, /* CN symbol 4 */
146 { 0x48, 0x04 }, /* CN manual mode */
147 { 0x50, 0xd5 }, { 0x51, 0x01 },
148 { 0x50, 0xd6 }, { 0x51, 0x1f },
149 { 0x50, 0xd2 }, { 0x51, 0x03 },
150 { 0x50, 0xd7 }, { 0x51, 0x3f },
151 { 0x1c, 0x01 },
152 { 0x28, 0x06 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x03 },
153 { 0x28, 0x07 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0d },
154 { 0x28, 0x08 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x02 },
155 { 0x28, 0x09 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x01 },
156 { 0x28, 0x0a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x21 },
157 { 0x28, 0x0b }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x29 },
158 { 0x28, 0x0c }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x16 },
159 { 0x28, 0x0d }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x31 },
160 { 0x28, 0x0e }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0e },
161 { 0x28, 0x0f }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x4e },
162 { 0x28, 0x10 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x46 },
163 { 0x28, 0x11 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0f },
164 { 0x28, 0x12 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x56 },
165 { 0x28, 0x13 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x35 },
166 { 0x28, 0x14 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbe },
167 { 0x28, 0x15 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0x84 },
168 { 0x28, 0x16 }, { 0x29, 0x00 }, { 0x2a, 0x03 }, { 0x2b, 0xee },
169 { 0x28, 0x17 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x98 },
170 { 0x28, 0x18 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x9f },
171 { 0x28, 0x19 }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xb2 },
172 { 0x28, 0x1a }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0xc2 },
173 { 0x28, 0x1b }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0x4a },
174 { 0x28, 0x1c }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbc },
175 { 0x28, 0x1d }, { 0x29, 0x00 }, { 0x2a, 0x04 }, { 0x2b, 0xba },
176 { 0x28, 0x1e }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0x14 },
177 { 0x50, 0x1e }, { 0x51, 0x5d },
178 { 0x50, 0x22 }, { 0x51, 0x00 },
179 { 0x50, 0x23 }, { 0x51, 0xc8 },
180 { 0x50, 0x24 }, { 0x51, 0x00 },
181 { 0x50, 0x25 }, { 0x51, 0xf0 },
182 { 0x50, 0x26 }, { 0x51, 0x00 },
183 { 0x50, 0x27 }, { 0x51, 0xc3 },
184 { 0x50, 0x39 }, { 0x51, 0x02 },
185 { 0x50, 0xd5 }, { 0x51, 0x01 },
186 { 0xd0, 0x00 },
190 { 0x70, 0xf0 },
191 { 0x70, 0xff },
192 { 0x08, 0x01 },
193 { 0x08, 0x00 },
197 { 0x53, 0x00 }, /* pre BER Counter reset */
198 { 0x53, 0x07 },
200 { 0x5f, 0x00 }, /* post BER Counter reset */
201 { 0x5f, 0x07 },
203 { 0x50, 0xb1 }, /* PER Counter reset */
204 { 0x51, 0x07 },
205 { 0x51, 0x00 },
217 .addr = i2c_addr, .flags = 0, .buf = buf, .len = 2 in mb86a20s_i2c_writereg()
224 "%s: writereg error (rc == %i, reg == 0x%02x, data == 0x%02x)\n", in mb86a20s_i2c_writereg()
229 return 0; in mb86a20s_i2c_writereg()
237 for (i = 0; i < size; i++) { in mb86a20s_i2c_writeregdata()
240 if (rc < 0) in mb86a20s_i2c_writeregdata()
243 return 0; in mb86a20s_i2c_writeregdata()
252 { .addr = i2c_addr, .flags = 0, .buf = ®, .len = 1 }, in mb86a20s_i2c_readreg()
259 dev_err(&state->i2c->dev, "%s: reg=0x%x (error=%d)\n", in mb86a20s_i2c_readreg()
261 return (rc < 0) ? rc : -EIO; in mb86a20s_i2c_readreg()
286 *status = 0; in mb86a20s_read_status()
288 val = mb86a20s_readreg(state, 0x0a); in mb86a20s_read_status()
289 if (val < 0) in mb86a20s_read_status()
292 val &= 0xf; in mb86a20s_read_status()
312 dev_dbg(&state->i2c->dev, "%s: Status = 0x%02x (state = %d)\n", in mb86a20s_read_status()
327 return c->strength.stat[0].uvalue; in mb86a20s_read_signal_strength()
330 c->strength.stat[0].uvalue = 0; in mb86a20s_read_signal_strength()
333 rf_max = 0xfff; in mb86a20s_read_signal_strength()
334 rf_min = 0; in mb86a20s_read_signal_strength()
337 rc = mb86a20s_writereg(state, 0x04, 0x1f); in mb86a20s_read_signal_strength()
338 if (rc < 0) in mb86a20s_read_signal_strength()
340 rc = mb86a20s_writereg(state, 0x05, rf >> 8); in mb86a20s_read_signal_strength()
341 if (rc < 0) in mb86a20s_read_signal_strength()
343 rc = mb86a20s_writereg(state, 0x04, 0x20); in mb86a20s_read_signal_strength()
344 if (rc < 0) in mb86a20s_read_signal_strength()
346 rc = mb86a20s_writereg(state, 0x05, rf); in mb86a20s_read_signal_strength()
347 if (rc < 0) in mb86a20s_read_signal_strength()
350 rc = mb86a20s_readreg(state, 0x02); in mb86a20s_read_signal_strength()
351 if (rc < 0) in mb86a20s_read_signal_strength()
353 if (rc & 0x08) in mb86a20s_read_signal_strength()
368 c->strength.stat[0].uvalue = rf; in mb86a20s_read_signal_strength()
371 return 0; in mb86a20s_read_signal_strength()
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()
388 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_modulation()
389 if (rc < 0) in mb86a20s_get_modulation()
391 rc = mb86a20s_readreg(state, 0x6e); in mb86a20s_get_modulation()
392 if (rc < 0) in mb86a20s_get_modulation()
394 switch ((rc >> 4) & 0x07) { in mb86a20s_get_modulation()
395 case 0: in mb86a20s_get_modulation()
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()
421 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_fec()
422 if (rc < 0) in mb86a20s_get_fec()
424 rc = mb86a20s_readreg(state, 0x6e); in mb86a20s_get_fec()
425 if (rc < 0) in mb86a20s_get_fec()
427 switch ((rc >> 4) & 0x07) { in mb86a20s_get_fec()
428 case 0: in mb86a20s_get_fec()
448 0, 1, 2, 4, 8 in mb86a20s_get_interleaving()
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()
459 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_interleaving()
460 if (rc < 0) in mb86a20s_get_interleaving()
462 rc = mb86a20s_readreg(state, 0x6e); in mb86a20s_get_interleaving()
463 if (rc < 0) in mb86a20s_get_interleaving()
466 return interleaving[(rc >> 4) & 0x07]; in mb86a20s_get_interleaving()
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()
484 rc = mb86a20s_writereg(state, 0x6d, reg[layer]); in mb86a20s_get_segment_count()
485 if (rc < 0) in mb86a20s_get_segment_count()
487 rc = mb86a20s_readreg(state, 0x6e); in mb86a20s_get_segment_count()
488 if (rc < 0) in mb86a20s_get_segment_count()
490 count = (rc >> 4) & 0x0f; in mb86a20s_get_segment_count()
509 c->isdbt_layer_enabled = 0; in mb86a20s_reset_frontend_cache()
512 c->isdbt_sb_mode = 0; in mb86a20s_reset_frontend_cache()
513 c->isdbt_sb_segment_count = 0; in mb86a20s_reset_frontend_cache()
556 mod = 0; in isdbt_layer_min_bitrate()
570 fec = 0; in isdbt_layer_min_bitrate()
589 guard = 0; in isdbt_layer_min_bitrate()
617 rc = mb86a20s_writereg(state, 0x6d, 0x85); in mb86a20s_get_frontend()
618 if (rc < 0) in mb86a20s_get_frontend()
620 rc = mb86a20s_readreg(state, 0x6e); in mb86a20s_get_frontend()
621 if (rc < 0) in mb86a20s_get_frontend()
623 c->isdbt_partial_reception = (rc & 0x10) ? 1 : 0; in mb86a20s_get_frontend()
627 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_frontend()
632 if (rc < 0) in mb86a20s_get_frontend()
634 if (rc >= 0 && rc < 14) { 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()
643 if (rc < 0) in mb86a20s_get_frontend()
649 if (rc < 0) in mb86a20s_get_frontend()
655 if (rc < 0) in mb86a20s_get_frontend()
671 "%s: layer %c bitrate: %d kbps; counter = %d (0x%06x)\n", in mb86a20s_get_frontend()
677 rc = mb86a20s_writereg(state, 0x6d, 0x84); in mb86a20s_get_frontend()
678 if (rc < 0) in mb86a20s_get_frontend()
680 if ((rc & 0x60) == 0x20) { in mb86a20s_get_frontend()
688 rc = mb86a20s_readreg(state, 0x07); in mb86a20s_get_frontend()
689 if (rc < 0) in mb86a20s_get_frontend()
692 if ((rc & 0x60) == 0x20) { in mb86a20s_get_frontend()
694 switch ((rc >> 2) & 0x03) { in mb86a20s_get_frontend()
704 if (!(rc & 0x10)) { in mb86a20s_get_frontend()
706 switch (rc & 0x3) { in mb86a20s_get_frontend()
707 case 0: in mb86a20s_get_frontend()
718 return 0; in mb86a20s_get_frontend()
723 c->isdbt_layer_enabled = 0; in mb86a20s_get_frontend()
738 memset(&c->cnr, 0, sizeof(c->cnr)); in mb86a20s_reset_counters()
739 memset(&c->pre_bit_error, 0, sizeof(c->pre_bit_error)); in mb86a20s_reset_counters()
740 memset(&c->pre_bit_count, 0, sizeof(c->pre_bit_count)); in mb86a20s_reset_counters()
741 memset(&c->post_bit_error, 0, sizeof(c->post_bit_error)); in mb86a20s_reset_counters()
742 memset(&c->post_bit_count, 0, sizeof(c->post_bit_count)); in mb86a20s_reset_counters()
743 memset(&c->block_error, 0, sizeof(c->block_error)); in mb86a20s_reset_counters()
744 memset(&c->block_count, 0, sizeof(c->block_count)); in mb86a20s_reset_counters()
753 if (rc < 0) in mb86a20s_reset_counters()
757 rc = mb86a20s_readreg(state, 0x45); in mb86a20s_reset_counters()
758 if (rc < 0) in mb86a20s_reset_counters()
761 rc = mb86a20s_writereg(state, 0x45, val | 0x10); in mb86a20s_reset_counters()
762 if (rc < 0) in mb86a20s_reset_counters()
764 rc = mb86a20s_writereg(state, 0x45, val & 0x6f); in mb86a20s_reset_counters()
765 if (rc < 0) in mb86a20s_reset_counters()
769 rc = mb86a20s_writereg(state, 0x50, 0x50); in mb86a20s_reset_counters()
770 if (rc < 0) in mb86a20s_reset_counters()
772 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_reset_counters()
773 if (rc < 0) in mb86a20s_reset_counters()
776 rc = mb86a20s_writereg(state, 0x51, val | 0x01); in mb86a20s_reset_counters()
777 if (rc < 0) in mb86a20s_reset_counters()
779 rc = mb86a20s_writereg(state, 0x51, val & 0x06); in mb86a20s_reset_counters()
780 if (rc < 0) in mb86a20s_reset_counters()
805 rc = mb86a20s_readreg(state, 0x54); in mb86a20s_get_pre_ber()
806 if (rc < 0) in mb86a20s_get_pre_ber()
818 rc = mb86a20s_readreg(state, 0x55 + layer * 3); in mb86a20s_get_pre_ber()
819 if (rc < 0) in mb86a20s_get_pre_ber()
822 rc = mb86a20s_readreg(state, 0x56 + layer * 3); in mb86a20s_get_pre_ber()
823 if (rc < 0) in mb86a20s_get_pre_ber()
826 rc = mb86a20s_readreg(state, 0x57 + layer * 3); in mb86a20s_get_pre_ber()
827 if (rc < 0) in mb86a20s_get_pre_ber()
836 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3); in mb86a20s_get_pre_ber()
837 if (rc < 0) in mb86a20s_get_pre_ber()
839 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_pre_ber()
840 if (rc < 0) in mb86a20s_get_pre_ber()
843 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3); in mb86a20s_get_pre_ber()
844 if (rc < 0) in mb86a20s_get_pre_ber()
846 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_pre_ber()
847 if (rc < 0) in mb86a20s_get_pre_ber()
850 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3); in mb86a20s_get_pre_ber()
851 if (rc < 0) in mb86a20s_get_pre_ber()
853 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_pre_ber()
854 if (rc < 0) in mb86a20s_get_pre_ber()
877 rc = mb86a20s_writereg(state, 0x52, 0x00); in mb86a20s_get_pre_ber()
880 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3); in mb86a20s_get_pre_ber()
881 if (rc < 0) in mb86a20s_get_pre_ber()
883 rc = mb86a20s_writereg(state, 0x51, in mb86a20s_get_pre_ber()
885 if (rc < 0) in mb86a20s_get_pre_ber()
887 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3); in mb86a20s_get_pre_ber()
888 if (rc < 0) in mb86a20s_get_pre_ber()
890 rc = mb86a20s_writereg(state, 0x51, in mb86a20s_get_pre_ber()
892 if (rc < 0) in mb86a20s_get_pre_ber()
894 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3); in mb86a20s_get_pre_ber()
895 if (rc < 0) in mb86a20s_get_pre_ber()
897 rc = mb86a20s_writereg(state, 0x51, in mb86a20s_get_pre_ber()
899 if (rc < 0) in mb86a20s_get_pre_ber()
903 rc = mb86a20s_writereg(state, 0x52, 0x01); in mb86a20s_get_pre_ber()
906 rc = mb86a20s_writereg(state, 0x53, 0x00); in mb86a20s_get_pre_ber()
907 if (rc < 0) in mb86a20s_get_pre_ber()
909 rc = mb86a20s_writereg(state, 0x53, 0x07); in mb86a20s_get_pre_ber()
912 rc = mb86a20s_readreg(state, 0x53); in mb86a20s_get_pre_ber()
913 if (rc < 0) in mb86a20s_get_pre_ber()
916 rc = mb86a20s_writereg(state, 0x53, val & ~(1 << layer)); in mb86a20s_get_pre_ber()
917 if (rc < 0) in mb86a20s_get_pre_ber()
919 rc = mb86a20s_writereg(state, 0x53, val | (1 << layer)); in mb86a20s_get_pre_ber()
939 rc = mb86a20s_readreg(state, 0x60); in mb86a20s_get_post_ber()
940 if (rc < 0) in mb86a20s_get_post_ber()
952 rc = mb86a20s_readreg(state, 0x64 + layer * 3); in mb86a20s_get_post_ber()
953 if (rc < 0) in mb86a20s_get_post_ber()
956 rc = mb86a20s_readreg(state, 0x65 + layer * 3); in mb86a20s_get_post_ber()
957 if (rc < 0) in mb86a20s_get_post_ber()
960 rc = mb86a20s_readreg(state, 0x66 + layer * 3); in mb86a20s_get_post_ber()
961 if (rc < 0) in mb86a20s_get_post_ber()
970 rc = mb86a20s_writereg(state, 0x50, 0xdc + layer * 2); in mb86a20s_get_post_ber()
971 if (rc < 0) in mb86a20s_get_post_ber()
973 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_post_ber()
974 if (rc < 0) in mb86a20s_get_post_ber()
977 rc = mb86a20s_writereg(state, 0x50, 0xdd + layer * 2); in mb86a20s_get_post_ber()
978 if (rc < 0) in mb86a20s_get_post_ber()
980 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_post_ber()
981 if (rc < 0) in mb86a20s_get_post_ber()
1011 rc = mb86a20s_writereg(state, 0x5e, 0x00); in mb86a20s_get_post_ber()
1014 rc = mb86a20s_writereg(state, 0x50, 0xdc + layer * 2); in mb86a20s_get_post_ber()
1015 if (rc < 0) in mb86a20s_get_post_ber()
1017 rc = mb86a20s_writereg(state, 0x51, collect_rate >> 8); in mb86a20s_get_post_ber()
1018 if (rc < 0) in mb86a20s_get_post_ber()
1020 rc = mb86a20s_writereg(state, 0x50, 0xdd + layer * 2); in mb86a20s_get_post_ber()
1021 if (rc < 0) in mb86a20s_get_post_ber()
1023 rc = mb86a20s_writereg(state, 0x51, collect_rate & 0xff); in mb86a20s_get_post_ber()
1024 if (rc < 0) in mb86a20s_get_post_ber()
1028 rc = mb86a20s_writereg(state, 0x5e, 0x07); in mb86a20s_get_post_ber()
1031 rc = mb86a20s_writereg(state, 0x5f, 0x00); in mb86a20s_get_post_ber()
1032 if (rc < 0) in mb86a20s_get_post_ber()
1034 rc = mb86a20s_writereg(state, 0x5f, 0x07); in mb86a20s_get_post_ber()
1041 rc = mb86a20s_readreg(state, 0x5f); in mb86a20s_get_post_ber()
1042 if (rc < 0) in mb86a20s_get_post_ber()
1045 rc = mb86a20s_writereg(state, 0x5f, val & ~(1 << layer)); in mb86a20s_get_post_ber()
1046 if (rc < 0) in mb86a20s_get_post_ber()
1048 rc = mb86a20s_writereg(state, 0x5f, val | (1 << layer)); in mb86a20s_get_post_ber()
1066 rc = mb86a20s_writereg(state, 0x50, 0xb8); in mb86a20s_get_blk_error()
1067 if (rc < 0) in mb86a20s_get_blk_error()
1069 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1070 if (rc < 0) in mb86a20s_get_blk_error()
1083 rc = mb86a20s_writereg(state, 0x50, 0xb9 + layer * 2); in mb86a20s_get_blk_error()
1084 if (rc < 0) in mb86a20s_get_blk_error()
1086 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1087 if (rc < 0) in mb86a20s_get_blk_error()
1090 rc = mb86a20s_writereg(state, 0x50, 0xba + layer * 2); in mb86a20s_get_blk_error()
1091 if (rc < 0) in mb86a20s_get_blk_error()
1093 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1094 if (rc < 0) in mb86a20s_get_blk_error()
1101 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2); in mb86a20s_get_blk_error()
1102 if (rc < 0) in mb86a20s_get_blk_error()
1104 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1105 if (rc < 0) in mb86a20s_get_blk_error()
1108 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2); in mb86a20s_get_blk_error()
1109 if (rc < 0) in mb86a20s_get_blk_error()
1111 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1112 if (rc < 0) in mb86a20s_get_blk_error()
1142 rc = mb86a20s_writereg(state, 0x50, 0xb0); in mb86a20s_get_blk_error()
1143 if (rc < 0) in mb86a20s_get_blk_error()
1145 rc = mb86a20s_writereg(state, 0x51, 0x00); in mb86a20s_get_blk_error()
1146 if (rc < 0) in mb86a20s_get_blk_error()
1150 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2); in mb86a20s_get_blk_error()
1151 if (rc < 0) in mb86a20s_get_blk_error()
1153 rc = mb86a20s_writereg(state, 0x51, collect_rate >> 8); in mb86a20s_get_blk_error()
1154 if (rc < 0) in mb86a20s_get_blk_error()
1156 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2); in mb86a20s_get_blk_error()
1157 if (rc < 0) in mb86a20s_get_blk_error()
1159 rc = mb86a20s_writereg(state, 0x51, collect_rate & 0xff); in mb86a20s_get_blk_error()
1160 if (rc < 0) in mb86a20s_get_blk_error()
1164 rc = mb86a20s_writereg(state, 0x50, 0xb0); in mb86a20s_get_blk_error()
1165 if (rc < 0) in mb86a20s_get_blk_error()
1167 rc = mb86a20s_writereg(state, 0x51, 0x07); in mb86a20s_get_blk_error()
1168 if (rc < 0) in mb86a20s_get_blk_error()
1172 rc = mb86a20s_writereg(state, 0x50, 0xb1); in mb86a20s_get_blk_error()
1173 if (rc < 0) in mb86a20s_get_blk_error()
1175 rc = mb86a20s_writereg(state, 0x51, 0x07); in mb86a20s_get_blk_error()
1176 if (rc < 0) in mb86a20s_get_blk_error()
1178 rc = mb86a20s_writereg(state, 0x51, 0x00); in mb86a20s_get_blk_error()
1185 rc = mb86a20s_writereg(state, 0x50, 0xb1); in mb86a20s_get_blk_error()
1186 if (rc < 0) in mb86a20s_get_blk_error()
1188 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error()
1189 if (rc < 0) in mb86a20s_get_blk_error()
1192 rc = mb86a20s_writereg(state, 0x51, val | (1 << layer)); in mb86a20s_get_blk_error()
1193 if (rc < 0) in mb86a20s_get_blk_error()
1195 rc = mb86a20s_writereg(state, 0x51, val & ~(1 << layer)); in mb86a20s_get_blk_error()
1209 { 19648, 0},
1243 { 3922688, 0},
1277 { 5314816, 0},
1311 { 2834176, 0},
1351 if (value >= segments[0].x) in interpolate_value()
1352 return segments[0].y; in interpolate_value()
1383 rc = mb86a20s_readreg(state, 0x45); in mb86a20s_get_main_CNR()
1384 if (rc < 0) in mb86a20s_get_main_CNR()
1387 if (!(rc & 0x40)) { in mb86a20s_get_main_CNR()
1394 rc = mb86a20s_readreg(state, 0x46); in mb86a20s_get_main_CNR()
1395 if (rc < 0) in mb86a20s_get_main_CNR()
1399 rc = mb86a20s_readreg(state, 0x46); in mb86a20s_get_main_CNR()
1400 if (rc < 0) in mb86a20s_get_main_CNR()
1407 c->cnr.stat[0].scale = FE_SCALE_DECIBEL; in mb86a20s_get_main_CNR()
1408 c->cnr.stat[0].svalue = cnr; in mb86a20s_get_main_CNR()
1414 rc = mb86a20s_writereg(state, 0x45, val | 0x10); in mb86a20s_get_main_CNR()
1415 if (rc < 0) in mb86a20s_get_main_CNR()
1417 rc = mb86a20s_writereg(state, 0x45, val & 0x6f); in mb86a20s_get_main_CNR()
1434 rc = mb86a20s_writereg(state, 0x50, 0x5b); in mb86a20s_get_blk_error_layer_CNR()
1435 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1437 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error_layer_CNR()
1438 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1442 if (!(rc & 0x01)) { in mb86a20s_get_blk_error_layer_CNR()
1449 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_blk_error_layer_CNR()
1455 rc = mb86a20s_writereg(state, 0x50, 0x52 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1456 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1458 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error_layer_CNR()
1459 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1462 rc = mb86a20s_writereg(state, 0x50, 0x53 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1463 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1465 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error_layer_CNR()
1466 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1469 rc = mb86a20s_writereg(state, 0x50, 0x54 + layer * 3); in mb86a20s_get_blk_error_layer_CNR()
1470 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1472 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error_layer_CNR()
1473 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1506 rc = mb86a20s_writereg(state, 0x50, 0x50); in mb86a20s_get_blk_error_layer_CNR()
1507 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1509 rc = mb86a20s_readreg(state, 0x51); in mb86a20s_get_blk_error_layer_CNR()
1510 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1514 rc = mb86a20s_writereg(state, 0x51, val | 0x01); in mb86a20s_get_blk_error_layer_CNR()
1515 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1517 rc = mb86a20s_writereg(state, 0x51, val & 0x06); in mb86a20s_get_blk_error_layer_CNR()
1518 if (rc < 0) in mb86a20s_get_blk_error_layer_CNR()
1521 return 0; in mb86a20s_get_blk_error_layer_CNR()
1547 c->strength.stat[0].scale = FE_SCALE_RELATIVE; in mb86a20s_stats_not_ready()
1548 c->strength.stat[0].uvalue = 0; in mb86a20s_stats_not_ready()
1551 for (layer = 0; layer < NUM_LAYERS + 1; layer++) { in mb86a20s_stats_not_ready()
1566 int rc = 0, layer; in mb86a20s_get_stats()
1567 u32 bit_error = 0, bit_count = 0; in mb86a20s_get_stats()
1568 u32 t_pre_bit_error = 0, t_pre_bit_count = 0; in mb86a20s_get_stats()
1569 u32 t_post_bit_error = 0, t_post_bit_count = 0; in mb86a20s_get_stats()
1570 u32 block_error = 0, block_count = 0; in mb86a20s_get_stats()
1571 u32 t_block_error = 0, t_block_count = 0; in mb86a20s_get_stats()
1572 int pre_ber_layers = 0, post_ber_layers = 0; in mb86a20s_get_stats()
1573 int per_layers = 0; in mb86a20s_get_stats()
1588 return 0; in mb86a20s_get_stats()
1590 for (layer = 0; layer < NUM_LAYERS; layer++) { in mb86a20s_get_stats()
1595 if (rc >= 0) { in mb86a20s_get_stats()
1617 if (rc >= 0) { in mb86a20s_get_stats()
1640 if (rc >= 0) { in mb86a20s_get_stats()
1686 c->pre_bit_error.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1687 c->pre_bit_error.stat[0].uvalue = t_pre_bit_error; in mb86a20s_get_stats()
1688 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1689 c->pre_bit_count.stat[0].uvalue = t_pre_bit_count; in mb86a20s_get_stats()
1691 c->pre_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1692 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1707 c->post_bit_error.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1708 c->post_bit_error.stat[0].uvalue = t_post_bit_error; in mb86a20s_get_stats()
1709 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1710 c->post_bit_count.stat[0].uvalue = t_post_bit_count; in mb86a20s_get_stats()
1712 c->post_bit_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1713 c->post_bit_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1724 c->block_error.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1725 c->block_error.stat[0].uvalue = t_block_error; in mb86a20s_get_stats()
1726 c->block_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1727 c->block_count.stat[0].uvalue = t_block_count; in mb86a20s_get_stats()
1729 c->block_error.stat[0].scale = FE_SCALE_NOT_AVAILABLE; in mb86a20s_get_stats()
1730 c->block_count.stat[0].scale = FE_SCALE_COUNTER; in mb86a20s_get_stats()
1747 u8 regD5 = 1, reg71, reg09 = 0x3a; in mb86a20s_initfe()
1752 fe->ops.i2c_gate_ctrl(fe, 0); in mb86a20s_initfe()
1756 if (rc < 0) in mb86a20s_initfe()
1760 reg09 |= 0x04; in mb86a20s_initfe()
1761 rc = mb86a20s_writereg(state, 0x09, reg09); in mb86a20s_initfe()
1762 if (rc < 0) in mb86a20s_initfe()
1767 reg71 = 0; in mb86a20s_initfe()
1768 rc = mb86a20s_writereg(state, 0x39, reg71); in mb86a20s_initfe()
1769 if (rc < 0) in mb86a20s_initfe()
1771 rc = mb86a20s_writereg(state, 0x71, state->bw); in mb86a20s_initfe()
1772 if (rc < 0) in mb86a20s_initfe()
1775 rc = mb86a20s_writereg(state, 0x44, state->subchannel); in mb86a20s_initfe()
1776 if (rc < 0) in mb86a20s_initfe()
1794 rc = mb86a20s_writereg(state, 0x28, 0x2a); in mb86a20s_initfe()
1795 if (rc < 0) in mb86a20s_initfe()
1797 rc = mb86a20s_writereg(state, 0x29, (pll >> 16) & 0xff); in mb86a20s_initfe()
1798 if (rc < 0) in mb86a20s_initfe()
1800 rc = mb86a20s_writereg(state, 0x2a, (pll >> 8) & 0xff); in mb86a20s_initfe()
1801 if (rc < 0) in mb86a20s_initfe()
1803 rc = mb86a20s_writereg(state, 0x2b, pll & 0xff); in mb86a20s_initfe()
1804 if (rc < 0) in mb86a20s_initfe()
1806 dev_dbg(&state->i2c->dev, "%s: fclk=%d, IF=%d, clock reg=0x%06llx\n", in mb86a20s_initfe()
1812 rc = mb86a20s_writereg(state, 0x28, 0x20); in mb86a20s_initfe()
1813 if (rc < 0) in mb86a20s_initfe()
1815 rc = mb86a20s_writereg(state, 0x29, (pll >> 16) & 0xff); in mb86a20s_initfe()
1816 if (rc < 0) in mb86a20s_initfe()
1818 rc = mb86a20s_writereg(state, 0x2a, (pll >> 8) & 0xff); in mb86a20s_initfe()
1819 if (rc < 0) in mb86a20s_initfe()
1821 rc = mb86a20s_writereg(state, 0x2b, pll & 0xff); in mb86a20s_initfe()
1822 if (rc < 0) in mb86a20s_initfe()
1824 dev_dbg(&state->i2c->dev, "%s: IF=%d, IF reg=0x%06llx\n", in mb86a20s_initfe()
1830 rc = mb86a20s_writereg(state, 0x50, 0xd5); in mb86a20s_initfe()
1831 if (rc < 0) in mb86a20s_initfe()
1833 rc = mb86a20s_writereg(state, 0x51, regD5); in mb86a20s_initfe()
1834 if (rc < 0) in mb86a20s_initfe()
1838 if (rc < 0) in mb86a20s_initfe()
1846 if (rc < 0) { in mb86a20s_initfe()
1880 state->subchannel = 0; in mb86a20s_set_frontend()
1883 c->isdbt_sb_subchannel = 0; in mb86a20s_set_frontend()
1919 fe->ops.i2c_gate_ctrl(fe, 0); in mb86a20s_set_frontend()
1940 fe->ops.i2c_gate_ctrl(fe, 0); in mb86a20s_read_status_and_stats()
1948 if (status_nr < 0) { in mb86a20s_read_status_and_stats()
1957 if (rc < 0) { in mb86a20s_read_status_and_stats()
1963 rc = 0; /* Status is OK */ in mb86a20s_read_status_and_stats()
1970 if (rc < 0) { in mb86a20s_read_status_and_stats()
1973 rc = 0; /* Status is OK */ in mb86a20s_read_status_and_stats()
1979 if (rc < 0 && rc != -EBUSY) { in mb86a20s_read_status_and_stats()
1982 rc = 0; in mb86a20s_read_status_and_stats()
1985 rc = 0; /* Don't return EBUSY to userspace */ in mb86a20s_read_status_and_stats()
2005 *strength = c->strength.stat[0].uvalue; in mb86a20s_read_signal_strength_from_cache()
2007 return 0; in mb86a20s_read_signal_strength_from_cache()
2017 int rc = 0; in mb86a20s_tune()
2069 rev = mb86a20s_readreg(state, 0); in mb86a20s_attach()
2070 if (rev != 0x13) { in mb86a20s_attach()