2 * Fujitu mb86a20s ISDB-T/ISDB-Tsb Module driver
4 * Copyright (C) 2010-2013 Mauro Carvalho Chehab <mchehab@redhat.com>
5 * Copyright (C) 2009-2010 Douglas Landgraf <dougsland@redhat.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
17 #include <linux/kernel.h>
18 #include <asm/div64.h>
20 #include "dvb_frontend.h"
24 module_param(debug, int, 0644);
25 MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
27 struct mb86a20s_state {
28 struct i2c_adapter *i2c;
29 const struct mb86a20s_config *config;
32 struct dvb_frontend frontend;
34 u32 estimated_rate[3];
44 #define BER_SAMPLING_RATE 1 /* Seconds */
47 * Initialization sequence: Use whatevere default values that PV SBTVD
48 * does on its initialisation, obtained via USB snoop
50 static struct regdata mb86a20s_init[] = {
55 { 0x50, 0xd1 }, { 0x51, 0x22 },
58 { 0x28, 0x2a }, { 0x29, 0x00 }, { 0x2a, 0xff }, { 0x2b, 0x80 },
59 { 0x28, 0x20 }, { 0x29, 0x33 }, { 0x2a, 0xdf }, { 0x2b, 0xa9 },
60 { 0x28, 0x22 }, { 0x29, 0x00 }, { 0x2a, 0x1f }, { 0x2b, 0xf0 },
64 { 0x04, 0x08 }, { 0x05, 0x05 },
65 { 0x04, 0x0e }, { 0x05, 0x00 },
66 { 0x04, 0x0f }, { 0x05, 0x14 },
67 { 0x04, 0x0b }, { 0x05, 0x8c },
68 { 0x04, 0x00 }, { 0x05, 0x00 },
69 { 0x04, 0x01 }, { 0x05, 0x07 },
70 { 0x04, 0x02 }, { 0x05, 0x0f },
71 { 0x04, 0x03 }, { 0x05, 0xa0 },
72 { 0x04, 0x09 }, { 0x05, 0x00 },
73 { 0x04, 0x0a }, { 0x05, 0xff },
74 { 0x04, 0x27 }, { 0x05, 0x64 },
75 { 0x04, 0x28 }, { 0x05, 0x00 },
76 { 0x04, 0x1e }, { 0x05, 0xff },
77 { 0x04, 0x29 }, { 0x05, 0x0a },
78 { 0x04, 0x32 }, { 0x05, 0x0a },
79 { 0x04, 0x14 }, { 0x05, 0x02 },
80 { 0x04, 0x04 }, { 0x05, 0x00 },
81 { 0x04, 0x05 }, { 0x05, 0x22 },
82 { 0x04, 0x06 }, { 0x05, 0x0e },
83 { 0x04, 0x07 }, { 0x05, 0xd8 },
84 { 0x04, 0x12 }, { 0x05, 0x00 },
85 { 0x04, 0x13 }, { 0x05, 0xff },
86 { 0x04, 0x15 }, { 0x05, 0x4e },
87 { 0x04, 0x16 }, { 0x05, 0x20 },
90 * On this demod, when the bit count reaches the count below,
91 * it collects the bit error count. The bit counters are initialized
92 * to 65535 here. This warrants that all of them will be quickly
93 * calculated when device gets locked. As TMCC is parsed, the values
94 * will be adjusted later in the driver's code.
96 { 0x52, 0x01 }, /* Turn on BER before Viterbi */
97 { 0x50, 0xa7 }, { 0x51, 0x00 },
98 { 0x50, 0xa8 }, { 0x51, 0xff },
99 { 0x50, 0xa9 }, { 0x51, 0xff },
100 { 0x50, 0xaa }, { 0x51, 0x00 },
101 { 0x50, 0xab }, { 0x51, 0xff },
102 { 0x50, 0xac }, { 0x51, 0xff },
103 { 0x50, 0xad }, { 0x51, 0x00 },
104 { 0x50, 0xae }, { 0x51, 0xff },
105 { 0x50, 0xaf }, { 0x51, 0xff },
107 { 0x5e, 0x00 }, /* Turn off BER after Viterbi */
108 { 0x50, 0xdc }, { 0x51, 0x01 },
109 { 0x50, 0xdd }, { 0x51, 0xf4 },
110 { 0x50, 0xde }, { 0x51, 0x01 },
111 { 0x50, 0xdf }, { 0x51, 0xf4 },
112 { 0x50, 0xe0 }, { 0x51, 0x01 },
113 { 0x50, 0xe1 }, { 0x51, 0xf4 },
116 * On this demod, when the block count reaches the count below,
117 * it collects the block error count. The block counters are initialized
118 * to 127 here. This warrants that all of them will be quickly
119 * calculated when device gets locked. As TMCC is parsed, the values
120 * will be adjusted later in the driver's code.
122 { 0x50, 0xb0 }, { 0x51, 0x07 }, /* Enable PER */
123 { 0x50, 0xb2 }, { 0x51, 0x00 },
124 { 0x50, 0xb3 }, { 0x51, 0x7f },
125 { 0x50, 0xb4 }, { 0x51, 0x00 },
126 { 0x50, 0xb5 }, { 0x51, 0x7f },
127 { 0x50, 0xb6 }, { 0x51, 0x00 },
128 { 0x50, 0xb7 }, { 0x51, 0x7f },
130 { 0x50, 0x50 }, { 0x51, 0x02 }, /* MER manual mode */
131 { 0x50, 0x51 }, { 0x51, 0x04 }, /* MER symbol 4 */
132 { 0x45, 0x04 }, /* CN symbol 4 */
133 { 0x48, 0x04 }, /* CN manual mode */
135 { 0x50, 0xd5 }, { 0x51, 0x01 }, /* Serial */
136 { 0x50, 0xd6 }, { 0x51, 0x1f },
137 { 0x50, 0xd2 }, { 0x51, 0x03 },
138 { 0x50, 0xd7 }, { 0x51, 0x3f },
139 { 0x28, 0x74 }, { 0x29, 0x00 }, { 0x28, 0x74 }, { 0x29, 0x40 },
140 { 0x28, 0x46 }, { 0x29, 0x2c }, { 0x28, 0x46 }, { 0x29, 0x0c },
142 { 0x04, 0x40 }, { 0x05, 0x00 },
143 { 0x28, 0x00 }, { 0x29, 0x10 },
144 { 0x28, 0x05 }, { 0x29, 0x02 },
146 { 0x28, 0x06 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x03 },
147 { 0x28, 0x07 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0d },
148 { 0x28, 0x08 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x02 },
149 { 0x28, 0x09 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x01 },
150 { 0x28, 0x0a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x21 },
151 { 0x28, 0x0b }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x29 },
152 { 0x28, 0x0c }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x16 },
153 { 0x28, 0x0d }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x31 },
154 { 0x28, 0x0e }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0e },
155 { 0x28, 0x0f }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x4e },
156 { 0x28, 0x10 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x46 },
157 { 0x28, 0x11 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x0f },
158 { 0x28, 0x12 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x56 },
159 { 0x28, 0x13 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x35 },
160 { 0x28, 0x14 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbe },
161 { 0x28, 0x15 }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0x84 },
162 { 0x28, 0x16 }, { 0x29, 0x00 }, { 0x2a, 0x03 }, { 0x2b, 0xee },
163 { 0x28, 0x17 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x98 },
164 { 0x28, 0x18 }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x9f },
165 { 0x28, 0x19 }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0xb2 },
166 { 0x28, 0x1a }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0xc2 },
167 { 0x28, 0x1b }, { 0x29, 0x00 }, { 0x2a, 0x07 }, { 0x2b, 0x4a },
168 { 0x28, 0x1c }, { 0x29, 0x00 }, { 0x2a, 0x01 }, { 0x2b, 0xbc },
169 { 0x28, 0x1d }, { 0x29, 0x00 }, { 0x2a, 0x04 }, { 0x2b, 0xba },
170 { 0x28, 0x1e }, { 0x29, 0x00 }, { 0x2a, 0x06 }, { 0x2b, 0x14 },
171 { 0x50, 0x1e }, { 0x51, 0x5d },
172 { 0x50, 0x22 }, { 0x51, 0x00 },
173 { 0x50, 0x23 }, { 0x51, 0xc8 },
174 { 0x50, 0x24 }, { 0x51, 0x00 },
175 { 0x50, 0x25 }, { 0x51, 0xf0 },
176 { 0x50, 0x26 }, { 0x51, 0x00 },
177 { 0x50, 0x27 }, { 0x51, 0xc3 },
178 { 0x50, 0x39 }, { 0x51, 0x02 },
179 { 0x28, 0x6a }, { 0x29, 0x00 }, { 0x2a, 0x00 }, { 0x2b, 0x00 },
183 static struct regdata mb86a20s_reset_reception[] = {
190 static struct regdata mb86a20s_vber_reset[] = {
191 { 0x53, 0x00 }, /* VBER Counter reset */
195 static struct regdata mb86a20s_per_reset[] = {
196 { 0x50, 0xb1 }, /* PER Counter reset */
202 * I2C read/write functions and macros
205 static int mb86a20s_i2c_writereg(struct mb86a20s_state *state,
206 u8 i2c_addr, u8 reg, u8 data)
208 u8 buf[] = { reg, data };
209 struct i2c_msg msg = {
210 .addr = i2c_addr, .flags = 0, .buf = buf, .len = 2
214 rc = i2c_transfer(state->i2c, &msg, 1);
216 dev_err(&state->i2c->dev,
217 "%s: writereg error (rc == %i, reg == 0x%02x, data == 0x%02x)\n",
218 __func__, rc, reg, data);
225 static int mb86a20s_i2c_writeregdata(struct mb86a20s_state *state,
226 u8 i2c_addr, struct regdata *rd, int size)
230 for (i = 0; i < size; i++) {
231 rc = mb86a20s_i2c_writereg(state, i2c_addr, rd[i].reg,
239 static int mb86a20s_i2c_readreg(struct mb86a20s_state *state,
244 struct i2c_msg msg[] = {
245 { .addr = i2c_addr, .flags = 0, .buf = ®, .len = 1 },
246 { .addr = i2c_addr, .flags = I2C_M_RD, .buf = &val, .len = 1 }
249 rc = i2c_transfer(state->i2c, msg, 2);
252 dev_err(&state->i2c->dev, "%s: reg=0x%x (error=%d)\n",
254 return (rc < 0) ? rc : -EIO;
260 #define mb86a20s_readreg(state, reg) \
261 mb86a20s_i2c_readreg(state, state->config->demod_address, reg)
262 #define mb86a20s_writereg(state, reg, val) \
263 mb86a20s_i2c_writereg(state, state->config->demod_address, reg, val)
264 #define mb86a20s_writeregdata(state, regdata) \
265 mb86a20s_i2c_writeregdata(state, state->config->demod_address, \
266 regdata, ARRAY_SIZE(regdata))
269 * Ancillary internal routines (likely compiled inlined)
271 * The functions below assume that gateway lock has already obtained
274 static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status)
276 struct mb86a20s_state *state = fe->demodulator_priv;
281 val = mb86a20s_readreg(state, 0x0a) & 0xf;
286 *status |= FE_HAS_SIGNAL;
289 *status |= FE_HAS_CARRIER;
292 *status |= FE_HAS_VITERBI;
295 *status |= FE_HAS_SYNC;
297 if (val >= 8) /* Maybe 9? */
298 *status |= FE_HAS_LOCK;
300 dev_dbg(&state->i2c->dev, "%s: Status = 0x%02x (state = %d)\n",
301 __func__, *status, val);
306 static int mb86a20s_read_signal_strength(struct dvb_frontend *fe)
308 struct mb86a20s_state *state = fe->demodulator_priv;
310 unsigned rf_max, rf_min, rf;
312 /* Does a binary search to get RF strength */
316 rf = (rf_max + rf_min) / 2;
317 rc = mb86a20s_writereg(state, 0x04, 0x1f);
320 rc = mb86a20s_writereg(state, 0x05, rf >> 8);
323 rc = mb86a20s_writereg(state, 0x04, 0x20);
326 rc = mb86a20s_writereg(state, 0x04, rf);
330 rc = mb86a20s_readreg(state, 0x02);
334 rf_min = (rf_max + rf_min) / 2;
336 rf_max = (rf_max + rf_min) / 2;
337 if (rf_max - rf_min < 4) {
338 rf = (rf_max + rf_min) / 2;
340 /* Rescale it from 2^12 (4096) to 2^16 */
342 dev_dbg(&state->i2c->dev,
343 "%s: signal strength = %d (%d < RF=%d < %d)\n",
344 __func__, rf, rf_min, rf >> 4, rf_max);
352 static int mb86a20s_get_modulation(struct mb86a20s_state *state,
356 static unsigned char reg[] = {
357 [0] = 0x86, /* Layer A */
358 [1] = 0x8a, /* Layer B */
359 [2] = 0x8e, /* Layer C */
362 if (layer >= ARRAY_SIZE(reg))
364 rc = mb86a20s_writereg(state, 0x6d, reg[layer]);
367 rc = mb86a20s_readreg(state, 0x6e);
370 switch ((rc >> 4) & 0x07) {
384 static int mb86a20s_get_fec(struct mb86a20s_state *state,
389 static unsigned char reg[] = {
390 [0] = 0x87, /* Layer A */
391 [1] = 0x8b, /* Layer B */
392 [2] = 0x8f, /* Layer C */
395 if (layer >= ARRAY_SIZE(reg))
397 rc = mb86a20s_writereg(state, 0x6d, reg[layer]);
400 rc = mb86a20s_readreg(state, 0x6e);
403 switch ((rc >> 4) & 0x07) {
419 static int mb86a20s_get_interleaving(struct mb86a20s_state *state,
424 static unsigned char reg[] = {
425 [0] = 0x88, /* Layer A */
426 [1] = 0x8c, /* Layer B */
427 [2] = 0x90, /* Layer C */
430 if (layer >= ARRAY_SIZE(reg))
432 rc = mb86a20s_writereg(state, 0x6d, reg[layer]);
435 rc = mb86a20s_readreg(state, 0x6e);
439 switch ((rc >> 4) & 0x07) {
441 return GUARD_INTERVAL_1_4;
443 return GUARD_INTERVAL_1_8;
445 return GUARD_INTERVAL_1_16;
447 return GUARD_INTERVAL_1_32;
451 return GUARD_INTERVAL_AUTO;
455 static int mb86a20s_get_segment_count(struct mb86a20s_state *state,
459 static unsigned char reg[] = {
460 [0] = 0x89, /* Layer A */
461 [1] = 0x8d, /* Layer B */
462 [2] = 0x91, /* Layer C */
465 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
467 if (layer >= ARRAY_SIZE(reg))
470 rc = mb86a20s_writereg(state, 0x6d, reg[layer]);
473 rc = mb86a20s_readreg(state, 0x6e);
476 count = (rc >> 4) & 0x0f;
478 dev_dbg(&state->i2c->dev, "%s: segments: %d.\n", __func__, count);
483 static void mb86a20s_reset_frontend_cache(struct dvb_frontend *fe)
485 struct mb86a20s_state *state = fe->demodulator_priv;
486 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
488 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
490 /* Fixed parameters */
491 c->delivery_system = SYS_ISDBT;
492 c->bandwidth_hz = 6000000;
494 /* Initialize values that will be later autodetected */
495 c->isdbt_layer_enabled = 0;
496 c->transmission_mode = TRANSMISSION_MODE_AUTO;
497 c->guard_interval = GUARD_INTERVAL_AUTO;
498 c->isdbt_sb_mode = 0;
499 c->isdbt_sb_segment_count = 0;
503 * Estimates the bit rate using the per-segment bit rate given by
504 * ABNT/NBR 15601 spec (table 4).
506 static u32 isdbt_rate[3][5][4] = {
508 { 280850, 312060, 330420, 340430 }, /* 1/2 */
509 { 374470, 416080, 440560, 453910 }, /* 2/3 */
510 { 421280, 468090, 495630, 510650 }, /* 3/4 */
511 { 468090, 520100, 550700, 567390 }, /* 5/6 */
512 { 491500, 546110, 578230, 595760 }, /* 7/8 */
514 { 561710, 624130, 660840, 680870 }, /* 1/2 */
515 { 748950, 832170, 881120, 907820 }, /* 2/3 */
516 { 842570, 936190, 991260, 1021300 }, /* 3/4 */
517 { 936190, 1040210, 1101400, 1134780 }, /* 5/6 */
518 { 983000, 1092220, 1156470, 1191520 }, /* 7/8 */
520 { 842570, 936190, 991260, 1021300 }, /* 1/2 */
521 { 1123430, 1248260, 1321680, 1361740 }, /* 2/3 */
522 { 1263860, 1404290, 1486900, 1531950 }, /* 3/4 */
523 { 1404290, 1560320, 1652110, 1702170 }, /* 5/6 */
524 { 1474500, 1638340, 1734710, 1787280 }, /* 7/8 */
528 static void mb86a20s_layer_bitrate(struct dvb_frontend *fe, u32 layer,
529 u32 modulation, u32 fec, u32 interleaving,
532 struct mb86a20s_state *state = fe->demodulator_priv;
537 * If modulation/fec/interleaving is not detected, the default is
538 * to consider the lowest bit rate, to avoid taking too long time
541 switch (modulation) {
575 switch (interleaving) {
577 case GUARD_INTERVAL_1_4:
580 case GUARD_INTERVAL_1_8:
583 case GUARD_INTERVAL_1_16:
586 case GUARD_INTERVAL_1_32:
591 /* Samples BER at BER_SAMPLING_RATE seconds */
592 rate = isdbt_rate[m][f][i] * segment * BER_SAMPLING_RATE;
594 /* Avoids sampling too quickly or to overflow the register */
597 else if (rate > (1 << 24) - 1)
598 rate = (1 << 24) - 1;
600 dev_dbg(&state->i2c->dev,
601 "%s: layer %c bitrate: %d kbps; counter = %d (0x%06x)\n",
602 __func__, 'A' + layer, segment * isdbt_rate[m][f][i]/1000,
605 state->estimated_rate[i] = rate;
609 static int mb86a20s_get_frontend(struct dvb_frontend *fe)
611 struct mb86a20s_state *state = fe->demodulator_priv;
612 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
615 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
617 /* Reset frontend cache to default values */
618 mb86a20s_reset_frontend_cache(fe);
620 /* Check for partial reception */
621 rc = mb86a20s_writereg(state, 0x6d, 0x85);
624 rc = mb86a20s_readreg(state, 0x6e);
627 c->isdbt_partial_reception = (rc & 0x10) ? 1 : 0;
629 /* Get per-layer data */
631 for (i = 0; i < 3; i++) {
632 dev_dbg(&state->i2c->dev, "%s: getting data for layer %c.\n",
635 rc = mb86a20s_get_segment_count(state, i);
637 goto noperlayer_error;
638 if (rc >= 0 && rc < 14) {
639 c->layer[i].segment_count = rc;
641 c->layer[i].segment_count = 0;
642 state->estimated_rate[i] = 0;
645 c->isdbt_layer_enabled |= 1 << i;
646 rc = mb86a20s_get_modulation(state, i);
648 goto noperlayer_error;
649 dev_dbg(&state->i2c->dev, "%s: modulation %d.\n",
651 c->layer[i].modulation = rc;
652 rc = mb86a20s_get_fec(state, i);
654 goto noperlayer_error;
655 dev_dbg(&state->i2c->dev, "%s: FEC %d.\n",
657 c->layer[i].fec = rc;
658 rc = mb86a20s_get_interleaving(state, i);
660 goto noperlayer_error;
661 dev_dbg(&state->i2c->dev, "%s: interleaving %d.\n",
663 c->layer[i].interleaving = rc;
664 mb86a20s_layer_bitrate(fe, i, c->layer[i].modulation,
666 c->layer[i].interleaving,
667 c->layer[i].segment_count);
670 rc = mb86a20s_writereg(state, 0x6d, 0x84);
673 if ((rc & 0x60) == 0x20) {
674 c->isdbt_sb_mode = 1;
675 /* At least, one segment should exist */
676 if (!c->isdbt_sb_segment_count)
677 c->isdbt_sb_segment_count = 1;
680 /* Get transmission mode and guard interval */
681 rc = mb86a20s_readreg(state, 0x07);
684 if ((rc & 0x60) == 0x20) {
685 switch (rc & 0x0c >> 2) {
687 c->transmission_mode = TRANSMISSION_MODE_2K;
690 c->transmission_mode = TRANSMISSION_MODE_4K;
693 c->transmission_mode = TRANSMISSION_MODE_8K;
700 c->guard_interval = GUARD_INTERVAL_1_4;
703 c->guard_interval = GUARD_INTERVAL_1_8;
706 c->guard_interval = GUARD_INTERVAL_1_16;
714 /* per-layer info is incomplete; discard all per-layer */
715 c->isdbt_layer_enabled = 0;
720 static int mb86a20s_reset_counters(struct dvb_frontend *fe)
722 struct mb86a20s_state *state = fe->demodulator_priv;
723 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
726 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
728 /* Reset the counters, if the channel changed */
729 if (state->last_frequency != c->frequency) {
730 memset(&c->strength, 0, sizeof(c->strength));
731 memset(&c->cnr, 0, sizeof(c->cnr));
732 memset(&c->pre_bit_error, 0, sizeof(c->pre_bit_error));
733 memset(&c->pre_bit_count, 0, sizeof(c->pre_bit_count));
734 memset(&c->block_error, 0, sizeof(c->block_error));
735 memset(&c->block_count, 0, sizeof(c->block_count));
737 state->last_frequency = c->frequency;
740 /* Clear status for most stats */
742 /* BER counter reset */
743 rc = mb86a20s_writeregdata(state, mb86a20s_vber_reset);
747 /* MER, PER counter reset */
748 rc = mb86a20s_writeregdata(state, mb86a20s_per_reset);
752 /* CNR counter reset */
753 rc = mb86a20s_readreg(state, 0x45);
757 rc = mb86a20s_writereg(state, 0x45, val | 0x10);
760 rc = mb86a20s_writereg(state, 0x45, val & 0x6f);
764 /* MER counter reset */
765 rc = mb86a20s_writereg(state, 0x50, 0x50);
768 rc = mb86a20s_readreg(state, 0x51);
772 rc = mb86a20s_writereg(state, 0x51, val | 0x01);
775 rc = mb86a20s_writereg(state, 0x51, val & 0x06);
781 dev_err(&state->i2c->dev,
782 "%s: Can't reset FE statistics (error %d).\n",
788 static int mb86a20s_get_ber_before_vterbi(struct dvb_frontend *fe,
790 u32 *error, u32 *count)
792 struct mb86a20s_state *state = fe->demodulator_priv;
795 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
800 /* Check if the BER measures are already available */
801 rc = mb86a20s_readreg(state, 0x54);
805 /* Check if data is available for that layer */
806 if (!(rc & (1 << layer))) {
807 dev_dbg(&state->i2c->dev,
808 "%s: BER for layer %c is not available yet.\n",
809 __func__, 'A' + layer);
813 /* Read Bit Error Count */
814 rc = mb86a20s_readreg(state, 0x55 + layer * 3);
818 rc = mb86a20s_readreg(state, 0x56 + layer * 3);
822 rc = mb86a20s_readreg(state, 0x57 + layer * 3);
827 dev_dbg(&state->i2c->dev,
828 "%s: bit error before Viterbi for layer %c: %d.\n",
829 __func__, 'A' + layer, *error);
832 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3);
835 rc = mb86a20s_readreg(state, 0x51);
839 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3);
842 rc = mb86a20s_readreg(state, 0x51);
846 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3);
849 rc = mb86a20s_readreg(state, 0x51);
854 dev_dbg(&state->i2c->dev,
855 "%s: bit count before Viterbi for layer %c: %d.\n",
856 __func__, 'A' + layer, *count);
860 * As we get TMCC data from the frontend, we can better estimate the
861 * BER bit counters, in order to do the BER measure during a longer
862 * time. Use those data, if available, to update the bit count
866 if (state->estimated_rate[layer]
867 && state->estimated_rate[layer] != *count) {
868 dev_dbg(&state->i2c->dev,
869 "%s: updating layer %c counter to %d.\n",
870 __func__, 'A' + layer, state->estimated_rate[layer]);
871 rc = mb86a20s_writereg(state, 0x50, 0xa7 + layer * 3);
874 rc = mb86a20s_writereg(state, 0x51,
875 state->estimated_rate[layer] >> 16);
878 rc = mb86a20s_writereg(state, 0x50, 0xa8 + layer * 3);
881 rc = mb86a20s_writereg(state, 0x51,
882 state->estimated_rate[layer] >> 8);
885 rc = mb86a20s_writereg(state, 0x50, 0xa9 + layer * 3);
888 rc = mb86a20s_writereg(state, 0x51,
889 state->estimated_rate[layer]);
895 /* Reset counter to collect new data */
896 rc = mb86a20s_writereg(state, 0x53, 0x07 & ~(1 << layer));
899 rc = mb86a20s_writereg(state, 0x53, 0x07);
904 static int mb86a20s_get_blk_error(struct dvb_frontend *fe,
906 u32 *error, u32 *count)
908 struct mb86a20s_state *state = fe->demodulator_priv;
911 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
916 /* Check if the PER measures are already available */
917 rc = mb86a20s_writereg(state, 0x50, 0xb8);
920 rc = mb86a20s_readreg(state, 0x51);
924 /* Check if data is available for that layer */
926 if (!(rc & (1 << layer))) {
927 dev_dbg(&state->i2c->dev,
928 "%s: block counts for layer %c aren't available yet.\n",
929 __func__, 'A' + layer);
933 /* Read Packet error Count */
934 rc = mb86a20s_writereg(state, 0x50, 0xb9 + layer * 2);
937 rc = mb86a20s_readreg(state, 0x51);
941 rc = mb86a20s_writereg(state, 0x50, 0xba + layer * 2);
944 rc = mb86a20s_readreg(state, 0x51);
948 dev_err(&state->i2c->dev, "%s: block error for layer %c: %d.\n",
949 __func__, 'A' + layer, *error);
952 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2);
955 rc = mb86a20s_readreg(state, 0x51);
959 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2);
962 rc = mb86a20s_readreg(state, 0x51);
967 dev_dbg(&state->i2c->dev,
968 "%s: block count for layer %c: %d.\n",
969 __func__, 'A' + layer, *count);
972 * As we get TMCC data from the frontend, we can better estimate the
973 * BER bit counters, in order to do the BER measure during a longer
974 * time. Use those data, if available, to update the bit count
978 if (!state->estimated_rate[layer])
979 goto reset_measurement;
981 collect_rate = state->estimated_rate[layer] / 204 / 8;
983 if (collect_rate < 32)
985 if (collect_rate > 65535)
986 collect_rate = 65535;
988 if (collect_rate != *count) {
989 dev_dbg(&state->i2c->dev,
990 "%s: updating PER counter on layer %c to %d.\n",
991 __func__, 'A' + layer, collect_rate);
992 rc = mb86a20s_writereg(state, 0x50, 0xb2 + layer * 2);
995 rc = mb86a20s_writereg(state, 0x51, collect_rate >> 8);
998 rc = mb86a20s_writereg(state, 0x50, 0xb3 + layer * 2);
1001 rc = mb86a20s_writereg(state, 0x51, collect_rate & 0xff);
1007 /* Reset counter to collect new data */
1008 rc = mb86a20s_writereg(state, 0x50, 0xb1);
1011 rc = mb86a20s_writereg(state, 0x51, (1 << layer));
1014 rc = mb86a20s_writereg(state, 0x51, 0x00);
1021 struct linear_segments {
1026 * All tables below return a dB/1000 measurement
1029 static struct linear_segments cnr_to_db_table[] = {
1063 static struct linear_segments cnr_64qam_table[] = {
1097 static struct linear_segments cnr_16qam_table[] = {
1131 struct linear_segments cnr_qpsk_table[] = {
1165 static u32 interpolate_value(u32 value, struct linear_segments *segments,
1172 if (value >= segments[0].x)
1173 return segments[0].y;
1174 if (value < segments[len-1].x)
1175 return segments[len-1].y;
1177 for (i = 1; i < len - 1; i++) {
1178 /* If value is identical, no need to interpolate */
1179 if (value == segments[i].x)
1180 return segments[i].y;
1181 if (value > segments[i].x)
1185 /* Linear interpolation between the two (x,y) points */
1186 dy = segments[i].y - segments[i - 1].y;
1187 dx = segments[i - 1].x - segments[i].x;
1188 tmp64 = value - segments[i].x;
1191 ret = segments[i].y - tmp64;
1196 static int mb86a20s_get_main_CNR(struct dvb_frontend *fe)
1198 struct mb86a20s_state *state = fe->demodulator_priv;
1199 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1200 u32 cnr_linear, cnr;
1203 /* Check if CNR is available */
1204 rc = mb86a20s_readreg(state, 0x45);
1209 dev_info(&state->i2c->dev, "%s: CNR is not available yet.\n",
1215 rc = mb86a20s_readreg(state, 0x46);
1218 cnr_linear = rc << 8;
1220 rc = mb86a20s_readreg(state, 0x46);
1225 cnr = interpolate_value(cnr_linear,
1226 cnr_to_db_table, ARRAY_SIZE(cnr_to_db_table));
1228 c->cnr.stat[0].scale = FE_SCALE_DECIBEL;
1229 c->cnr.stat[0].svalue = cnr;
1231 dev_dbg(&state->i2c->dev, "%s: CNR is %d.%03d dB (%d)\n",
1232 __func__, cnr / 1000, cnr % 1000, cnr_linear);
1234 /* CNR counter reset */
1235 rc = mb86a20s_writereg(state, 0x45, val | 0x10);
1238 rc = mb86a20s_writereg(state, 0x45, val & 0x6f);
1243 static int mb86a20s_get_blk_error_layer_CNR(struct dvb_frontend *fe)
1245 struct mb86a20s_state *state = fe->demodulator_priv;
1246 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1249 struct linear_segments *segs;
1252 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1254 /* Check if the measures are already available */
1255 rc = mb86a20s_writereg(state, 0x50, 0x5b);
1258 rc = mb86a20s_readreg(state, 0x51);
1262 /* Check if data is available */
1264 dev_info(&state->i2c->dev,
1265 "%s: MER measures aren't available yet.\n", __func__);
1269 /* Read all layers */
1270 for (i = 0; i < 3; i++) {
1271 if (!(c->isdbt_layer_enabled & (1 << i))) {
1272 c->cnr.stat[1 + i].scale = FE_SCALE_NOT_AVAILABLE;
1276 rc = mb86a20s_writereg(state, 0x50, 0x52 + i * 3);
1279 rc = mb86a20s_readreg(state, 0x51);
1283 rc = mb86a20s_writereg(state, 0x50, 0x53 + i * 3);
1286 rc = mb86a20s_readreg(state, 0x51);
1290 rc = mb86a20s_writereg(state, 0x50, 0x54 + i * 3);
1293 rc = mb86a20s_readreg(state, 0x51);
1298 switch (c->layer[i].modulation) {
1301 segs = cnr_qpsk_table;
1302 segs_len = ARRAY_SIZE(cnr_qpsk_table);
1305 segs = cnr_16qam_table;
1306 segs_len = ARRAY_SIZE(cnr_16qam_table);
1310 segs = cnr_64qam_table;
1311 segs_len = ARRAY_SIZE(cnr_64qam_table);
1314 cnr = interpolate_value(mer, segs, segs_len);
1316 c->cnr.stat[1 + i].scale = FE_SCALE_DECIBEL;
1317 c->cnr.stat[1 + i].svalue = cnr;
1319 dev_dbg(&state->i2c->dev,
1320 "%s: CNR for layer %c is %d.%03d dB (MER = %d).\n",
1321 __func__, 'A' + i, cnr / 1000, cnr % 1000, mer);
1325 /* Start a new MER measurement */
1326 /* MER counter reset */
1327 rc = mb86a20s_writereg(state, 0x50, 0x50);
1330 rc = mb86a20s_readreg(state, 0x51);
1335 rc = mb86a20s_writereg(state, 0x51, val | 0x01);
1338 rc = mb86a20s_writereg(state, 0x51, val & 0x06);
1345 static void mb86a20s_stats_not_ready(struct dvb_frontend *fe)
1347 struct mb86a20s_state *state = fe->demodulator_priv;
1348 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1351 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1353 /* Fill the length of each status counter */
1355 /* Only global stats */
1356 c->strength.len = 1;
1358 /* Per-layer stats - 3 layers + global */
1360 c->pre_bit_error.len = 4;
1361 c->pre_bit_count.len = 4;
1362 c->block_error.len = 4;
1363 c->block_count.len = 4;
1365 /* Signal is always available */
1366 c->strength.stat[0].scale = FE_SCALE_RELATIVE;
1367 c->strength.stat[0].uvalue = 0;
1369 /* Put all of them at FE_SCALE_NOT_AVAILABLE */
1370 for (i = 0; i < 4; i++) {
1371 c->cnr.stat[i].scale = FE_SCALE_NOT_AVAILABLE;
1372 c->pre_bit_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE;
1373 c->pre_bit_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE;
1374 c->block_error.stat[i].scale = FE_SCALE_NOT_AVAILABLE;
1375 c->block_count.stat[i].scale = FE_SCALE_NOT_AVAILABLE;
1379 static int mb86a20s_get_stats(struct dvb_frontend *fe)
1381 struct mb86a20s_state *state = fe->demodulator_priv;
1382 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1384 u32 bit_error = 0, bit_count = 0;
1385 u32 t_pre_bit_error = 0, t_pre_bit_count = 0;
1386 u32 block_error = 0, block_count = 0;
1387 u32 t_block_error = 0, t_block_count = 0;
1388 int active_layers = 0, ber_layers = 0, per_layers = 0;
1390 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1392 mb86a20s_get_main_CNR(fe);
1394 /* Get per-layer stats */
1395 mb86a20s_get_blk_error_layer_CNR(fe);
1397 for (i = 0; i < 3; i++) {
1398 if (c->isdbt_layer_enabled & (1 << i)) {
1399 /* Layer is active and has rc segments */
1402 /* Read per-layer BER */
1403 /* Handle BER before vterbi */
1404 rc = mb86a20s_get_ber_before_vterbi(fe, i,
1408 c->pre_bit_error.stat[1 + i].scale = FE_SCALE_COUNTER;
1409 c->pre_bit_error.stat[1 + i].uvalue += bit_error;
1410 c->pre_bit_count.stat[1 + i].scale = FE_SCALE_COUNTER;
1411 c->pre_bit_count.stat[1 + i].uvalue += bit_count;
1412 } else if (rc != -EBUSY) {
1414 * If an I/O error happened,
1415 * measures are now unavailable
1417 c->pre_bit_error.stat[1 + i].scale = FE_SCALE_NOT_AVAILABLE;
1418 c->pre_bit_count.stat[1 + i].scale = FE_SCALE_NOT_AVAILABLE;
1419 dev_err(&state->i2c->dev,
1420 "%s: Can't get BER for layer %c (error %d).\n",
1421 __func__, 'A' + i, rc);
1424 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
1427 /* Handle Block errors for PER/UCB reports */
1428 rc = mb86a20s_get_blk_error(fe, i,
1432 c->block_error.stat[1 + i].scale = FE_SCALE_COUNTER;
1433 c->block_error.stat[1 + i].uvalue += block_error;
1434 c->block_count.stat[1 + i].scale = FE_SCALE_COUNTER;
1435 c->block_count.stat[1 + i].uvalue += block_count;
1436 } else if (rc != -EBUSY) {
1438 * If an I/O error happened,
1439 * measures are now unavailable
1441 c->block_error.stat[1 + i].scale = FE_SCALE_NOT_AVAILABLE;
1442 c->block_count.stat[1 + i].scale = FE_SCALE_NOT_AVAILABLE;
1443 dev_err(&state->i2c->dev,
1444 "%s: Can't get PER for layer %c (error %d).\n",
1445 __func__, 'A' + i, rc);
1449 if (c->block_error.stat[1 + i].scale != FE_SCALE_NOT_AVAILABLE)
1452 /* Update total BER */
1453 t_pre_bit_error += c->pre_bit_error.stat[1 + i].uvalue;
1454 t_pre_bit_count += c->pre_bit_count.stat[1 + i].uvalue;
1456 /* Update total PER */
1457 t_block_error += c->block_error.stat[1 + i].uvalue;
1458 t_block_count += c->block_count.stat[1 + i].uvalue;
1463 * Start showing global count if at least one error count is
1468 * At least one per-layer BER measure was read. We can now
1469 * calculate the total BER
1471 * Total Bit Error/Count is calculated as the sum of the
1472 * bit errors on all active layers.
1474 c->pre_bit_error.stat[0].scale = FE_SCALE_COUNTER;
1475 c->pre_bit_error.stat[0].uvalue = t_pre_bit_error;
1476 c->pre_bit_count.stat[0].scale = FE_SCALE_COUNTER;
1477 c->pre_bit_count.stat[0].uvalue = t_pre_bit_count;
1482 * At least one per-layer UCB measure was read. We can now
1483 * calculate the total UCB
1485 * Total block Error/Count is calculated as the sum of the
1486 * block errors on all active layers.
1488 c->block_error.stat[0].scale = FE_SCALE_COUNTER;
1489 c->block_error.stat[0].uvalue = t_block_error;
1490 c->block_count.stat[0].scale = FE_SCALE_COUNTER;
1491 c->block_count.stat[0].uvalue = t_block_count;
1498 * The functions below are called via DVB callbacks, so they need to
1499 * properly use the I2C gate control
1502 static int mb86a20s_initfe(struct dvb_frontend *fe)
1504 struct mb86a20s_state *state = fe->demodulator_priv;
1508 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1510 if (fe->ops.i2c_gate_ctrl)
1511 fe->ops.i2c_gate_ctrl(fe, 0);
1513 /* Initialize the frontend */
1514 rc = mb86a20s_writeregdata(state, mb86a20s_init);
1518 if (!state->config->is_serial) {
1521 rc = mb86a20s_writereg(state, 0x50, 0xd5);
1524 rc = mb86a20s_writereg(state, 0x51, regD5);
1530 if (fe->ops.i2c_gate_ctrl)
1531 fe->ops.i2c_gate_ctrl(fe, 1);
1534 state->need_init = true;
1535 dev_info(&state->i2c->dev,
1536 "mb86a20s: Init failed. Will try again later\n");
1538 state->need_init = false;
1539 dev_dbg(&state->i2c->dev, "Initialization succeeded.\n");
1544 static int mb86a20s_set_frontend(struct dvb_frontend *fe)
1546 struct mb86a20s_state *state = fe->demodulator_priv;
1550 * FIXME: Properly implement the set frontend properties
1552 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1554 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1557 * Gate should already be opened, but it doesn't hurt to
1560 if (fe->ops.i2c_gate_ctrl)
1561 fe->ops.i2c_gate_ctrl(fe, 1);
1562 fe->ops.tuner_ops.set_params(fe);
1565 * Make it more reliable: if, for some reason, the initial
1566 * device initialization doesn't happen, initialize it when
1567 * a SBTVD parameters are adjusted.
1569 * Unfortunately, due to a hard to track bug at tda829x/tda18271,
1570 * the agc callback logic is not called during DVB attach time,
1571 * causing mb86a20s to not be initialized with Kworld SBTVD.
1572 * So, this hack is needed, in order to make Kworld SBTVD to work.
1574 if (state->need_init)
1575 mb86a20s_initfe(fe);
1577 if (fe->ops.i2c_gate_ctrl)
1578 fe->ops.i2c_gate_ctrl(fe, 0);
1580 rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception);
1581 mb86a20s_reset_counters(fe);
1583 if (fe->ops.i2c_gate_ctrl)
1584 fe->ops.i2c_gate_ctrl(fe, 1);
1589 static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe,
1590 fe_status_t *status)
1592 struct mb86a20s_state *state = fe->demodulator_priv;
1593 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1596 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1598 if (fe->ops.i2c_gate_ctrl)
1599 fe->ops.i2c_gate_ctrl(fe, 0);
1602 rc = mb86a20s_read_status(fe, status);
1603 if (!(*status & FE_HAS_LOCK)) {
1604 mb86a20s_stats_not_ready(fe);
1605 mb86a20s_reset_frontend_cache(fe);
1608 dev_err(&state->i2c->dev,
1609 "%s: Can't read frontend lock status\n", __func__);
1613 /* Get signal strength */
1614 rc = mb86a20s_read_signal_strength(fe);
1616 dev_err(&state->i2c->dev,
1617 "%s: Can't reset VBER registers.\n", __func__);
1618 mb86a20s_stats_not_ready(fe);
1619 mb86a20s_reset_frontend_cache(fe);
1621 rc = 0; /* Status is OK */
1624 /* Fill signal strength */
1625 c->strength.stat[0].uvalue = rc;
1627 if (*status & FE_HAS_LOCK) {
1629 rc = mb86a20s_get_frontend(fe);
1631 dev_err(&state->i2c->dev,
1632 "%s: Can't get FE TMCC data.\n", __func__);
1633 rc = 0; /* Status is OK */
1637 /* Get statistics */
1638 rc = mb86a20s_get_stats(fe);
1639 if (rc < 0 && rc != -EBUSY) {
1640 dev_err(&state->i2c->dev,
1641 "%s: Can't get FE statistics.\n", __func__);
1645 rc = 0; /* Don't return EBUSY to userspace */
1650 mb86a20s_stats_not_ready(fe);
1653 if (fe->ops.i2c_gate_ctrl)
1654 fe->ops.i2c_gate_ctrl(fe, 1);
1659 static int mb86a20s_read_signal_strength_from_cache(struct dvb_frontend *fe,
1662 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1665 *strength = c->strength.stat[0].uvalue;
1670 static int mb86a20s_get_frontend_dummy(struct dvb_frontend *fe)
1673 * get_frontend is now handled together with other stats
1674 * retrival, when read_status() is called, as some statistics
1675 * will depend on the layers detection.
1680 static int mb86a20s_tune(struct dvb_frontend *fe,
1682 unsigned int mode_flags,
1683 unsigned int *delay,
1684 fe_status_t *status)
1686 struct mb86a20s_state *state = fe->demodulator_priv;
1689 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1692 rc = mb86a20s_set_frontend(fe);
1694 if (!(mode_flags & FE_TUNE_MODE_ONESHOT))
1695 mb86a20s_read_status_and_stats(fe, status);
1700 static void mb86a20s_release(struct dvb_frontend *fe)
1702 struct mb86a20s_state *state = fe->demodulator_priv;
1704 dev_dbg(&state->i2c->dev, "%s called.\n", __func__);
1709 static struct dvb_frontend_ops mb86a20s_ops;
1711 struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
1712 struct i2c_adapter *i2c)
1714 struct mb86a20s_state *state;
1717 dev_dbg(&i2c->dev, "%s called.\n", __func__);
1719 /* allocate memory for the internal state */
1720 state = kzalloc(sizeof(struct mb86a20s_state), GFP_KERNEL);
1721 if (state == NULL) {
1723 "%s: unable to allocate memory for state\n", __func__);
1727 /* setup the state */
1728 state->config = config;
1731 /* create dvb_frontend */
1732 memcpy(&state->frontend.ops, &mb86a20s_ops,
1733 sizeof(struct dvb_frontend_ops));
1734 state->frontend.demodulator_priv = state;
1736 /* Check if it is a mb86a20s frontend */
1737 rev = mb86a20s_readreg(state, 0);
1741 "Detected a Fujitsu mb86a20s frontend\n");
1744 "Frontend revision %d is unknown - aborting.\n",
1749 return &state->frontend;
1755 EXPORT_SYMBOL(mb86a20s_attach);
1757 static struct dvb_frontend_ops mb86a20s_ops = {
1758 .delsys = { SYS_ISDBT },
1759 /* Use dib8000 values per default */
1761 .name = "Fujitsu mb86A20s",
1762 .caps = FE_CAN_INVERSION_AUTO | FE_CAN_RECOVER |
1763 FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
1764 FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
1765 FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
1766 FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_QAM_AUTO |
1767 FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,
1768 /* Actually, those values depend on the used tuner */
1769 .frequency_min = 45000000,
1770 .frequency_max = 864000000,
1771 .frequency_stepsize = 62500,
1774 .release = mb86a20s_release,
1776 .init = mb86a20s_initfe,
1777 .set_frontend = mb86a20s_set_frontend,
1778 .get_frontend = mb86a20s_get_frontend_dummy,
1779 .read_status = mb86a20s_read_status_and_stats,
1780 .read_signal_strength = mb86a20s_read_signal_strength_from_cache,
1781 .tune = mb86a20s_tune,
1784 MODULE_DESCRIPTION("DVB Frontend module for Fujitsu mb86A20s hardware");
1785 MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
1786 MODULE_LICENSE("GPL");