diff options
Diffstat (limited to 'drivers/media/dvb/frontends/tda10086.c')
-rw-r--r-- | drivers/media/dvb/frontends/tda10086.c | 147 |
1 files changed, 76 insertions, 71 deletions
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c index 0d2b69a99ad4..a17ce3c4ad86 100644 --- a/drivers/media/dvb/frontends/tda10086.c +++ b/drivers/media/dvb/frontends/tda10086.c | |||
@@ -43,7 +43,7 @@ struct tda10086_state { | |||
43 | bool has_lock; | 43 | bool has_lock; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static int debug = 0; | 46 | static int debug; |
47 | #define dprintk(args...) \ | 47 | #define dprintk(args...) \ |
48 | do { \ | 48 | do { \ |
49 | if (debug) printk(KERN_DEBUG "tda10086: " args); \ | 49 | if (debug) printk(KERN_DEBUG "tda10086: " args); \ |
@@ -60,7 +60,7 @@ static int tda10086_write_byte(struct tda10086_state *state, int reg, int data) | |||
60 | 60 | ||
61 | if (ret != 1) | 61 | if (ret != 1) |
62 | dprintk("%s: error reg=0x%x, data=0x%x, ret=%i\n", | 62 | dprintk("%s: error reg=0x%x, data=0x%x, ret=%i\n", |
63 | __FUNCTION__, reg, data, ret); | 63 | __func__, reg, data, ret); |
64 | 64 | ||
65 | return (ret != 1) ? ret : 0; | 65 | return (ret != 1) ? ret : 0; |
66 | } | 66 | } |
@@ -78,7 +78,7 @@ static int tda10086_read_byte(struct tda10086_state *state, int reg) | |||
78 | ret = i2c_transfer(state->i2c, msg, 2); | 78 | ret = i2c_transfer(state->i2c, msg, 2); |
79 | 79 | ||
80 | if (ret != 2) { | 80 | if (ret != 2) { |
81 | dprintk("%s: error reg=0x%x, ret=%i\n", __FUNCTION__, reg, | 81 | dprintk("%s: error reg=0x%x, ret=%i\n", __func__, reg, |
82 | ret); | 82 | ret); |
83 | return ret; | 83 | return ret; |
84 | } | 84 | } |
@@ -90,16 +90,16 @@ static int tda10086_write_mask(struct tda10086_state *state, int reg, int mask, | |||
90 | { | 90 | { |
91 | int val; | 91 | int val; |
92 | 92 | ||
93 | // read a byte and check | 93 | /* read a byte and check */ |
94 | val = tda10086_read_byte(state, reg); | 94 | val = tda10086_read_byte(state, reg); |
95 | if (val < 0) | 95 | if (val < 0) |
96 | return val; | 96 | return val; |
97 | 97 | ||
98 | // mask if off | 98 | /* mask if off */ |
99 | val = val & ~mask; | 99 | val = val & ~mask; |
100 | val |= data & 0xff; | 100 | val |= data & 0xff; |
101 | 101 | ||
102 | // write it out again | 102 | /* write it out again */ |
103 | return tda10086_write_byte(state, reg, val); | 103 | return tda10086_write_byte(state, reg, val); |
104 | } | 104 | } |
105 | 105 | ||
@@ -108,62 +108,67 @@ static int tda10086_init(struct dvb_frontend* fe) | |||
108 | struct tda10086_state* state = fe->demodulator_priv; | 108 | struct tda10086_state* state = fe->demodulator_priv; |
109 | u8 t22k_off = 0x80; | 109 | u8 t22k_off = 0x80; |
110 | 110 | ||
111 | dprintk ("%s\n", __FUNCTION__); | 111 | dprintk ("%s\n", __func__); |
112 | 112 | ||
113 | if (state->config->diseqc_tone) | 113 | if (state->config->diseqc_tone) |
114 | t22k_off = 0; | 114 | t22k_off = 0; |
115 | // reset | 115 | /* reset */ |
116 | tda10086_write_byte(state, 0x00, 0x00); | 116 | tda10086_write_byte(state, 0x00, 0x00); |
117 | msleep(10); | 117 | msleep(10); |
118 | 118 | ||
119 | // misc setup | 119 | /* misc setup */ |
120 | tda10086_write_byte(state, 0x01, 0x94); | 120 | tda10086_write_byte(state, 0x01, 0x94); |
121 | tda10086_write_byte(state, 0x02, 0x35); // NOTE: TT drivers appear to disable CSWP | 121 | tda10086_write_byte(state, 0x02, 0x35); /* NOTE: TT drivers appear to disable CSWP */ |
122 | tda10086_write_byte(state, 0x03, 0xe4); | 122 | tda10086_write_byte(state, 0x03, 0xe4); |
123 | tda10086_write_byte(state, 0x04, 0x43); | 123 | tda10086_write_byte(state, 0x04, 0x43); |
124 | tda10086_write_byte(state, 0x0c, 0x0c); | 124 | tda10086_write_byte(state, 0x0c, 0x0c); |
125 | tda10086_write_byte(state, 0x1b, 0xb0); // noise threshold | 125 | tda10086_write_byte(state, 0x1b, 0xb0); /* noise threshold */ |
126 | tda10086_write_byte(state, 0x20, 0x89); // misc | 126 | tda10086_write_byte(state, 0x20, 0x89); /* misc */ |
127 | tda10086_write_byte(state, 0x30, 0x04); // acquisition period length | 127 | tda10086_write_byte(state, 0x30, 0x04); /* acquisition period length */ |
128 | tda10086_write_byte(state, 0x32, 0x00); // irq off | 128 | tda10086_write_byte(state, 0x32, 0x00); /* irq off */ |
129 | tda10086_write_byte(state, 0x31, 0x56); // setup AFC | 129 | tda10086_write_byte(state, 0x31, 0x56); /* setup AFC */ |
130 | 130 | ||
131 | // setup PLL (assumes 16Mhz XIN) | 131 | /* setup PLL (this assumes SACLK = 96MHz) */ |
132 | tda10086_write_byte(state, 0x55, 0x2c); // misc PLL setup | 132 | tda10086_write_byte(state, 0x55, 0x2c); /* misc PLL setup */ |
133 | tda10086_write_byte(state, 0x3a, 0x0b); // M=12 | 133 | if (state->config->xtal_freq == TDA10086_XTAL_16M) { |
134 | tda10086_write_byte(state, 0x3b, 0x01); // P=2 | 134 | tda10086_write_byte(state, 0x3a, 0x0b); /* M=12 */ |
135 | tda10086_write_mask(state, 0x55, 0x20, 0x00); // powerup PLL | 135 | tda10086_write_byte(state, 0x3b, 0x01); /* P=2 */ |
136 | 136 | } else { | |
137 | // setup TS interface | 137 | tda10086_write_byte(state, 0x3a, 0x17); /* M=24 */ |
138 | tda10086_write_byte(state, 0x3b, 0x00); /* P=1 */ | ||
139 | } | ||
140 | tda10086_write_mask(state, 0x55, 0x20, 0x00); /* powerup PLL */ | ||
141 | |||
142 | /* setup TS interface */ | ||
138 | tda10086_write_byte(state, 0x11, 0x81); | 143 | tda10086_write_byte(state, 0x11, 0x81); |
139 | tda10086_write_byte(state, 0x12, 0x81); | 144 | tda10086_write_byte(state, 0x12, 0x81); |
140 | tda10086_write_byte(state, 0x19, 0x40); // parallel mode A + MSBFIRST | 145 | tda10086_write_byte(state, 0x19, 0x40); /* parallel mode A + MSBFIRST */ |
141 | tda10086_write_byte(state, 0x56, 0x80); // powerdown WPLL - unused in the mode we use | 146 | tda10086_write_byte(state, 0x56, 0x80); /* powerdown WPLL - unused in the mode we use */ |
142 | tda10086_write_byte(state, 0x57, 0x08); // bypass WPLL - unused in the mode we use | 147 | tda10086_write_byte(state, 0x57, 0x08); /* bypass WPLL - unused in the mode we use */ |
143 | tda10086_write_byte(state, 0x10, 0x2a); | 148 | tda10086_write_byte(state, 0x10, 0x2a); |
144 | 149 | ||
145 | // setup ADC | 150 | /* setup ADC */ |
146 | tda10086_write_byte(state, 0x58, 0x61); // ADC setup | 151 | tda10086_write_byte(state, 0x58, 0x61); /* ADC setup */ |
147 | tda10086_write_mask(state, 0x58, 0x01, 0x00); // powerup ADC | 152 | tda10086_write_mask(state, 0x58, 0x01, 0x00); /* powerup ADC */ |
148 | 153 | ||
149 | // setup AGC | 154 | /* setup AGC */ |
150 | tda10086_write_byte(state, 0x05, 0x0B); | 155 | tda10086_write_byte(state, 0x05, 0x0B); |
151 | tda10086_write_byte(state, 0x37, 0x63); | 156 | tda10086_write_byte(state, 0x37, 0x63); |
152 | tda10086_write_byte(state, 0x3f, 0x0a); // NOTE: flydvb varies it | 157 | tda10086_write_byte(state, 0x3f, 0x0a); /* NOTE: flydvb varies it */ |
153 | tda10086_write_byte(state, 0x40, 0x64); | 158 | tda10086_write_byte(state, 0x40, 0x64); |
154 | tda10086_write_byte(state, 0x41, 0x4f); | 159 | tda10086_write_byte(state, 0x41, 0x4f); |
155 | tda10086_write_byte(state, 0x42, 0x43); | 160 | tda10086_write_byte(state, 0x42, 0x43); |
156 | 161 | ||
157 | // setup viterbi | 162 | /* setup viterbi */ |
158 | tda10086_write_byte(state, 0x1a, 0x11); // VBER 10^6, DVB, QPSK | 163 | tda10086_write_byte(state, 0x1a, 0x11); /* VBER 10^6, DVB, QPSK */ |
159 | 164 | ||
160 | // setup carrier recovery | 165 | /* setup carrier recovery */ |
161 | tda10086_write_byte(state, 0x3d, 0x80); | 166 | tda10086_write_byte(state, 0x3d, 0x80); |
162 | 167 | ||
163 | // setup SEC | 168 | /* setup SEC */ |
164 | tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone | 169 | tda10086_write_byte(state, 0x36, t22k_off); /* all SEC off, 22k tone */ |
165 | tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency | 170 | tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); |
166 | tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // } | 171 | tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); |
167 | 172 | ||
168 | return 0; | 173 | return 0; |
169 | } | 174 | } |
@@ -173,7 +178,7 @@ static void tda10086_diseqc_wait(struct tda10086_state *state) | |||
173 | unsigned long timeout = jiffies + msecs_to_jiffies(200); | 178 | unsigned long timeout = jiffies + msecs_to_jiffies(200); |
174 | while (!(tda10086_read_byte(state, 0x50) & 0x01)) { | 179 | while (!(tda10086_read_byte(state, 0x50) & 0x01)) { |
175 | if(time_after(jiffies, timeout)) { | 180 | if(time_after(jiffies, timeout)) { |
176 | printk("%s: diseqc queue not ready, command may be lost.\n", __FUNCTION__); | 181 | printk("%s: diseqc queue not ready, command may be lost.\n", __func__); |
177 | break; | 182 | break; |
178 | } | 183 | } |
179 | msleep(10); | 184 | msleep(10); |
@@ -185,7 +190,7 @@ static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
185 | struct tda10086_state* state = fe->demodulator_priv; | 190 | struct tda10086_state* state = fe->demodulator_priv; |
186 | u8 t22k_off = 0x80; | 191 | u8 t22k_off = 0x80; |
187 | 192 | ||
188 | dprintk ("%s\n", __FUNCTION__); | 193 | dprintk ("%s\n", __func__); |
189 | 194 | ||
190 | if (state->config->diseqc_tone) | 195 | if (state->config->diseqc_tone) |
191 | t22k_off = 0; | 196 | t22k_off = 0; |
@@ -211,7 +216,7 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe, | |||
211 | u8 oldval; | 216 | u8 oldval; |
212 | u8 t22k_off = 0x80; | 217 | u8 t22k_off = 0x80; |
213 | 218 | ||
214 | dprintk ("%s\n", __FUNCTION__); | 219 | dprintk ("%s\n", __func__); |
215 | 220 | ||
216 | if (state->config->diseqc_tone) | 221 | if (state->config->diseqc_tone) |
217 | t22k_off = 0; | 222 | t22k_off = 0; |
@@ -239,7 +244,7 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic | |||
239 | u8 oldval = tda10086_read_byte(state, 0x36); | 244 | u8 oldval = tda10086_read_byte(state, 0x36); |
240 | u8 t22k_off = 0x80; | 245 | u8 t22k_off = 0x80; |
241 | 246 | ||
242 | dprintk ("%s\n", __FUNCTION__); | 247 | dprintk ("%s\n", __func__); |
243 | 248 | ||
244 | if (state->config->diseqc_tone) | 249 | if (state->config->diseqc_tone) |
245 | t22k_off = 0; | 250 | t22k_off = 0; |
@@ -266,7 +271,7 @@ static int tda10086_set_inversion(struct tda10086_state *state, | |||
266 | { | 271 | { |
267 | u8 invval = 0x80; | 272 | u8 invval = 0x80; |
268 | 273 | ||
269 | dprintk ("%s %i %i\n", __FUNCTION__, fe_params->inversion, state->config->invert); | 274 | dprintk ("%s %i %i\n", __func__, fe_params->inversion, state->config->invert); |
270 | 275 | ||
271 | switch(fe_params->inversion) { | 276 | switch(fe_params->inversion) { |
272 | case INVERSION_OFF: | 277 | case INVERSION_OFF: |
@@ -300,9 +305,9 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state, | |||
300 | u32 bdri; | 305 | u32 bdri; |
301 | u32 symbol_rate = fe_params->u.qpsk.symbol_rate; | 306 | u32 symbol_rate = fe_params->u.qpsk.symbol_rate; |
302 | 307 | ||
303 | dprintk ("%s %i\n", __FUNCTION__, symbol_rate); | 308 | dprintk ("%s %i\n", __func__, symbol_rate); |
304 | 309 | ||
305 | // setup the decimation and anti-aliasing filters.. | 310 | /* setup the decimation and anti-aliasing filters.. */ |
306 | if (symbol_rate < (u32) (SACLK * 0.0137)) { | 311 | if (symbol_rate < (u32) (SACLK * 0.0137)) { |
307 | dfn=4; | 312 | dfn=4; |
308 | afs=1; | 313 | afs=1; |
@@ -339,13 +344,13 @@ static int tda10086_set_symbol_rate(struct tda10086_state *state, | |||
339 | byp=1; | 344 | byp=1; |
340 | } | 345 | } |
341 | 346 | ||
342 | // calculate BDR | 347 | /* calculate BDR */ |
343 | big = (1ULL<<21) * ((u64) symbol_rate/1000ULL) * (1ULL<<dfn); | 348 | big = (1ULL<<21) * ((u64) symbol_rate/1000ULL) * (1ULL<<dfn); |
344 | big += ((SACLK/1000ULL)-1ULL); | 349 | big += ((SACLK/1000ULL)-1ULL); |
345 | do_div(big, (SACLK/1000ULL)); | 350 | do_div(big, (SACLK/1000ULL)); |
346 | bdr = big & 0xfffff; | 351 | bdr = big & 0xfffff; |
347 | 352 | ||
348 | // calculate BDRI | 353 | /* calculate BDRI */ |
349 | tmp = (1<<dfn)*(symbol_rate/1000); | 354 | tmp = (1<<dfn)*(symbol_rate/1000); |
350 | bdri = ((32 * (SACLK/1000)) + (tmp-1)) / tmp; | 355 | bdri = ((32 * (SACLK/1000)) + (tmp-1)) / tmp; |
351 | 356 | ||
@@ -366,7 +371,7 @@ static int tda10086_set_fec(struct tda10086_state *state, | |||
366 | { | 371 | { |
367 | u8 fecval; | 372 | u8 fecval; |
368 | 373 | ||
369 | dprintk ("%s %i\n", __FUNCTION__, fe_params->u.qpsk.fec_inner); | 374 | dprintk ("%s %i\n", __func__, fe_params->u.qpsk.fec_inner); |
370 | 375 | ||
371 | switch(fe_params->u.qpsk.fec_inner) { | 376 | switch(fe_params->u.qpsk.fec_inner) { |
372 | case FEC_1_2: | 377 | case FEC_1_2: |
@@ -412,13 +417,13 @@ static int tda10086_set_frontend(struct dvb_frontend* fe, | |||
412 | u32 freq = 0; | 417 | u32 freq = 0; |
413 | int freqoff; | 418 | int freqoff; |
414 | 419 | ||
415 | dprintk ("%s\n", __FUNCTION__); | 420 | dprintk ("%s\n", __func__); |
416 | 421 | ||
417 | // modify parameters for tuning | 422 | /* modify parameters for tuning */ |
418 | tda10086_write_byte(state, 0x02, 0x35); | 423 | tda10086_write_byte(state, 0x02, 0x35); |
419 | state->has_lock = false; | 424 | state->has_lock = false; |
420 | 425 | ||
421 | // set params | 426 | /* set params */ |
422 | if (fe->ops.tuner_ops.set_params) { | 427 | if (fe->ops.tuner_ops.set_params) { |
423 | fe->ops.tuner_ops.set_params(fe, fe_params); | 428 | fe->ops.tuner_ops.set_params(fe, fe_params); |
424 | if (fe->ops.i2c_gate_ctrl) | 429 | if (fe->ops.i2c_gate_ctrl) |
@@ -430,7 +435,7 @@ static int tda10086_set_frontend(struct dvb_frontend* fe, | |||
430 | fe->ops.i2c_gate_ctrl(fe, 0); | 435 | fe->ops.i2c_gate_ctrl(fe, 0); |
431 | } | 436 | } |
432 | 437 | ||
433 | // calcluate the frequency offset (in *Hz* not kHz) | 438 | /* calcluate the frequency offset (in *Hz* not kHz) */ |
434 | freqoff = fe_params->frequency - freq; | 439 | freqoff = fe_params->frequency - freq; |
435 | freqoff = ((1<<16) * freqoff) / (SACLK/1000); | 440 | freqoff = ((1<<16) * freqoff) / (SACLK/1000); |
436 | tda10086_write_byte(state, 0x3d, 0x80 | ((freqoff >> 8) & 0x7f)); | 441 | tda10086_write_byte(state, 0x3d, 0x80 | ((freqoff >> 8) & 0x7f)); |
@@ -443,7 +448,7 @@ static int tda10086_set_frontend(struct dvb_frontend* fe, | |||
443 | if ((ret = tda10086_set_fec(state, fe_params)) < 0) | 448 | if ((ret = tda10086_set_fec(state, fe_params)) < 0) |
444 | return ret; | 449 | return ret; |
445 | 450 | ||
446 | // soft reset + disable TS output until lock | 451 | /* soft reset + disable TS output until lock */ |
447 | tda10086_write_mask(state, 0x10, 0x40, 0x40); | 452 | tda10086_write_mask(state, 0x10, 0x40, 0x40); |
448 | tda10086_write_mask(state, 0x00, 0x01, 0x00); | 453 | tda10086_write_mask(state, 0x00, 0x01, 0x00); |
449 | 454 | ||
@@ -459,13 +464,13 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
459 | int tmp; | 464 | int tmp; |
460 | u64 tmp64; | 465 | u64 tmp64; |
461 | 466 | ||
462 | dprintk ("%s\n", __FUNCTION__); | 467 | dprintk ("%s\n", __func__); |
463 | 468 | ||
464 | // check for invalid symbol rate | 469 | /* check for invalid symbol rate */ |
465 | if (fe_params->u.qpsk.symbol_rate < 500000) | 470 | if (fe_params->u.qpsk.symbol_rate < 500000) |
466 | return -EINVAL; | 471 | return -EINVAL; |
467 | 472 | ||
468 | // calculate the updated frequency (note: we convert from Hz->kHz) | 473 | /* calculate the updated frequency (note: we convert from Hz->kHz) */ |
469 | tmp64 = tda10086_read_byte(state, 0x52); | 474 | tmp64 = tda10086_read_byte(state, 0x52); |
470 | tmp64 |= (tda10086_read_byte(state, 0x51) << 8); | 475 | tmp64 |= (tda10086_read_byte(state, 0x51) << 8); |
471 | if (tmp64 & 0x8000) | 476 | if (tmp64 & 0x8000) |
@@ -474,7 +479,7 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
474 | do_div(tmp64, (1ULL<<15) * (1ULL<<1)); | 479 | do_div(tmp64, (1ULL<<15) * (1ULL<<1)); |
475 | fe_params->frequency = (int) state->frequency + (int) tmp64; | 480 | fe_params->frequency = (int) state->frequency + (int) tmp64; |
476 | 481 | ||
477 | // the inversion | 482 | /* the inversion */ |
478 | val = tda10086_read_byte(state, 0x0c); | 483 | val = tda10086_read_byte(state, 0x0c); |
479 | if (val & 0x80) { | 484 | if (val & 0x80) { |
480 | switch(val & 0x40) { | 485 | switch(val & 0x40) { |
@@ -505,7 +510,7 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
505 | } | 510 | } |
506 | } | 511 | } |
507 | 512 | ||
508 | // calculate the updated symbol rate | 513 | /* calculate the updated symbol rate */ |
509 | tmp = tda10086_read_byte(state, 0x1d); | 514 | tmp = tda10086_read_byte(state, 0x1d); |
510 | if (tmp & 0x80) | 515 | if (tmp & 0x80) |
511 | tmp |= 0xffffff00; | 516 | tmp |= 0xffffff00; |
@@ -513,7 +518,7 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
513 | tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000); | 518 | tmp = ((state->symbol_rate/1000) * tmp) / (1000000/1000); |
514 | fe_params->u.qpsk.symbol_rate = state->symbol_rate + tmp; | 519 | fe_params->u.qpsk.symbol_rate = state->symbol_rate + tmp; |
515 | 520 | ||
516 | // the FEC | 521 | /* the FEC */ |
517 | val = (tda10086_read_byte(state, 0x0d) & 0x70) >> 4; | 522 | val = (tda10086_read_byte(state, 0x0d) & 0x70) >> 4; |
518 | switch(val) { | 523 | switch(val) { |
519 | case 0x00: | 524 | case 0x00: |
@@ -550,7 +555,7 @@ static int tda10086_read_status(struct dvb_frontend* fe, fe_status_t *fe_status) | |||
550 | struct tda10086_state* state = fe->demodulator_priv; | 555 | struct tda10086_state* state = fe->demodulator_priv; |
551 | u8 val; | 556 | u8 val; |
552 | 557 | ||
553 | dprintk ("%s\n", __FUNCTION__); | 558 | dprintk ("%s\n", __func__); |
554 | 559 | ||
555 | val = tda10086_read_byte(state, 0x0e); | 560 | val = tda10086_read_byte(state, 0x0e); |
556 | *fe_status = 0; | 561 | *fe_status = 0; |
@@ -566,7 +571,7 @@ static int tda10086_read_status(struct dvb_frontend* fe, fe_status_t *fe_status) | |||
566 | *fe_status |= FE_HAS_LOCK; | 571 | *fe_status |= FE_HAS_LOCK; |
567 | if (!state->has_lock) { | 572 | if (!state->has_lock) { |
568 | state->has_lock = true; | 573 | state->has_lock = true; |
569 | // modify parameters for stable reception | 574 | /* modify parameters for stable reception */ |
570 | tda10086_write_byte(state, 0x02, 0x00); | 575 | tda10086_write_byte(state, 0x02, 0x00); |
571 | } | 576 | } |
572 | } | 577 | } |
@@ -579,7 +584,7 @@ static int tda10086_read_signal_strength(struct dvb_frontend* fe, u16 * signal) | |||
579 | struct tda10086_state* state = fe->demodulator_priv; | 584 | struct tda10086_state* state = fe->demodulator_priv; |
580 | u8 _str; | 585 | u8 _str; |
581 | 586 | ||
582 | dprintk ("%s\n", __FUNCTION__); | 587 | dprintk ("%s\n", __func__); |
583 | 588 | ||
584 | _str = 0xff - tda10086_read_byte(state, 0x43); | 589 | _str = 0xff - tda10086_read_byte(state, 0x43); |
585 | *signal = (_str << 8) | _str; | 590 | *signal = (_str << 8) | _str; |
@@ -592,7 +597,7 @@ static int tda10086_read_snr(struct dvb_frontend* fe, u16 * snr) | |||
592 | struct tda10086_state* state = fe->demodulator_priv; | 597 | struct tda10086_state* state = fe->demodulator_priv; |
593 | u8 _snr; | 598 | u8 _snr; |
594 | 599 | ||
595 | dprintk ("%s\n", __FUNCTION__); | 600 | dprintk ("%s\n", __func__); |
596 | 601 | ||
597 | _snr = 0xff - tda10086_read_byte(state, 0x1c); | 602 | _snr = 0xff - tda10086_read_byte(state, 0x1c); |
598 | *snr = (_snr << 8) | _snr; | 603 | *snr = (_snr << 8) | _snr; |
@@ -604,12 +609,12 @@ static int tda10086_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
604 | { | 609 | { |
605 | struct tda10086_state* state = fe->demodulator_priv; | 610 | struct tda10086_state* state = fe->demodulator_priv; |
606 | 611 | ||
607 | dprintk ("%s\n", __FUNCTION__); | 612 | dprintk ("%s\n", __func__); |
608 | 613 | ||
609 | // read it | 614 | /* read it */ |
610 | *ucblocks = tda10086_read_byte(state, 0x18) & 0x7f; | 615 | *ucblocks = tda10086_read_byte(state, 0x18) & 0x7f; |
611 | 616 | ||
612 | // reset counter | 617 | /* reset counter */ |
613 | tda10086_write_byte(state, 0x18, 0x00); | 618 | tda10086_write_byte(state, 0x18, 0x00); |
614 | tda10086_write_byte(state, 0x18, 0x80); | 619 | tda10086_write_byte(state, 0x18, 0x80); |
615 | 620 | ||
@@ -620,9 +625,9 @@ static int tda10086_read_ber(struct dvb_frontend* fe, u32* ber) | |||
620 | { | 625 | { |
621 | struct tda10086_state* state = fe->demodulator_priv; | 626 | struct tda10086_state* state = fe->demodulator_priv; |
622 | 627 | ||
623 | dprintk ("%s\n", __FUNCTION__); | 628 | dprintk ("%s\n", __func__); |
624 | 629 | ||
625 | // read it | 630 | /* read it */ |
626 | *ber = 0; | 631 | *ber = 0; |
627 | *ber |= tda10086_read_byte(state, 0x15); | 632 | *ber |= tda10086_read_byte(state, 0x15); |
628 | *ber |= tda10086_read_byte(state, 0x16) << 8; | 633 | *ber |= tda10086_read_byte(state, 0x16) << 8; |
@@ -635,7 +640,7 @@ static int tda10086_sleep(struct dvb_frontend* fe) | |||
635 | { | 640 | { |
636 | struct tda10086_state* state = fe->demodulator_priv; | 641 | struct tda10086_state* state = fe->demodulator_priv; |
637 | 642 | ||
638 | dprintk ("%s\n", __FUNCTION__); | 643 | dprintk ("%s\n", __func__); |
639 | 644 | ||
640 | tda10086_write_mask(state, 0x00, 0x08, 0x08); | 645 | tda10086_write_mask(state, 0x00, 0x08, 0x08); |
641 | 646 | ||
@@ -646,7 +651,7 @@ static int tda10086_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | |||
646 | { | 651 | { |
647 | struct tda10086_state* state = fe->demodulator_priv; | 652 | struct tda10086_state* state = fe->demodulator_priv; |
648 | 653 | ||
649 | dprintk ("%s\n", __FUNCTION__); | 654 | dprintk ("%s\n", __func__); |
650 | 655 | ||
651 | if (enable) { | 656 | if (enable) { |
652 | tda10086_write_mask(state, 0x00, 0x10, 0x10); | 657 | tda10086_write_mask(state, 0x00, 0x10, 0x10); |
@@ -737,7 +742,7 @@ struct dvb_frontend* tda10086_attach(const struct tda10086_config* config, | |||
737 | { | 742 | { |
738 | struct tda10086_state *state; | 743 | struct tda10086_state *state; |
739 | 744 | ||
740 | dprintk ("%s\n", __FUNCTION__); | 745 | dprintk ("%s\n", __func__); |
741 | 746 | ||
742 | /* allocate memory for the internal state */ | 747 | /* allocate memory for the internal state */ |
743 | state = kmalloc(sizeof(struct tda10086_state), GFP_KERNEL); | 748 | state = kmalloc(sizeof(struct tda10086_state), GFP_KERNEL); |