Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (12899): DiB0070: Indenting driver with indent -linux

In order to follow a little bit the kernel coding style from now on
after the generation of that driver file and indent -linux call is
emitted.

Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Patrick Boettcher and committed by
Mauro Carvalho Chehab
2a6a30e0 7e5ce651

+417 -406
+403 -389
drivers/media/dvb/frontends/dib0070.c
··· 50 50 #define DIB0070S_P1A 0x02 51 51 52 52 enum frontend_tune_state { 53 - CT_TUNER_START = 10, 54 - CT_TUNER_STEP_0, 55 - CT_TUNER_STEP_1, 56 - CT_TUNER_STEP_2, 57 - CT_TUNER_STEP_3, 58 - CT_TUNER_STEP_4, 59 - CT_TUNER_STEP_5, 60 - CT_TUNER_STEP_6, 61 - CT_TUNER_STEP_7, 62 - CT_TUNER_STOP, 53 + CT_TUNER_START = 10, 54 + CT_TUNER_STEP_0, 55 + CT_TUNER_STEP_1, 56 + CT_TUNER_STEP_2, 57 + CT_TUNER_STEP_3, 58 + CT_TUNER_STEP_4, 59 + CT_TUNER_STEP_5, 60 + CT_TUNER_STEP_6, 61 + CT_TUNER_STEP_7, 62 + CT_TUNER_STOP, 63 63 }; 64 64 65 65 #define FE_CALLBACK_TIME_NEVER 0xffffffff ··· 71 71 u16 wbd_ff_offset; 72 72 u8 revision; 73 73 74 - enum frontend_tune_state tune_state; 75 - u32 current_rf; 74 + enum frontend_tune_state tune_state; 75 + u32 current_rf; 76 76 77 - /* for the captrim binary search */ 77 + /* for the captrim binary search */ 78 78 s8 step; 79 79 u16 adc_diff; 80 80 ··· 85 85 const struct dib0070_tuning *current_tune_table_index; 86 86 const struct dib0070_lna_match *lna_match; 87 87 88 - u8 wbd_gain_current; 88 + u8 wbd_gain_current; 89 89 u16 wbd_offset_3_3[2]; 90 90 }; 91 91 ··· 93 93 { 94 94 u8 b[2]; 95 95 struct i2c_msg msg[2] = { 96 - { .addr = state->cfg->i2c_address, .flags = 0, .buf = &reg, .len = 1 }, 97 - { .addr = state->cfg->i2c_address, .flags = I2C_M_RD, .buf = b, .len = 2 }, 96 + {.addr = state->cfg->i2c_address,.flags = 0,.buf = &reg,.len = 1}, 97 + {.addr = state->cfg->i2c_address,.flags = I2C_M_RD,.buf = b,.len = 2}, 98 98 }; 99 99 if (i2c_transfer(state->i2c, msg, 2) != 2) { 100 100 printk(KERN_WARNING "DiB0070 I2C read failed\n"); ··· 106 106 static int dib0070_write_reg(struct dib0070_state *state, u8 reg, u16 val) 107 107 { 108 108 u8 b[3] = { reg, val >> 8, val & 0xff }; 109 - struct i2c_msg msg = { .addr = state->cfg->i2c_address, .flags = 0, .buf = b, .len = 3 }; 109 + struct i2c_msg msg = {.addr = state->cfg->i2c_address,.flags = 0,.buf = b,.len = 3 }; 110 110 if (i2c_transfer(state->i2c, &msg, 1) != 1) { 111 111 printk(KERN_WARNING "DiB0070 I2C write failed\n"); 112 112 return -EREMOTEIO; ··· 124 124 125 125 static int dib0070_set_bandwidth(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch) 126 126 { 127 - struct dib0070_state *st = fe->tuner_priv; 128 - u16 tmp = dib0070_read_reg(st, 0x02) & 0x3fff; 127 + struct dib0070_state *state = fe->tuner_priv; 128 + u16 tmp = dib0070_read_reg(state, 0x02) & 0x3fff; 129 129 130 - if (fe->dtv_property_cache.bandwidth_hz/1000 > 7000) 131 - tmp |= (0 << 14); 132 - else if (fe->dtv_property_cache.bandwidth_hz/1000 > 6000) 133 - tmp |= (1 << 14); 134 - else if (fe->dtv_property_cache.bandwidth_hz/1000 > 5000) 135 - tmp |= (2 << 14); 136 - else 137 - tmp |= (3 << 14); 130 + if (state->fe->dtv_property_cache.bandwidth_hz / 1000 > 7000) 131 + tmp |= (0 << 14); 132 + else if (state->fe->dtv_property_cache.bandwidth_hz / 1000 > 6000) 133 + tmp |= (1 << 14); 134 + else if (state->fe->dtv_property_cache.bandwidth_hz / 1000 > 5000) 135 + tmp |= (2 << 14); 136 + else 137 + tmp |= (3 << 14); 138 138 139 - dib0070_write_reg(st, 0x02, tmp); 139 + dib0070_write_reg(state, 0x02, tmp); 140 140 141 - /* sharpen the BB filter in ISDB-T to have higher immunity to adjacent channels */ 142 - if (fe->dtv_property_cache.delivery_system == SYS_ISDBT) { 143 - u16 value = dib0070_read_reg(st, 0x17); 141 + /* sharpen the BB filter in ISDB-T to have higher immunity to adjacent channels */ 142 + if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT) { 143 + u16 value = dib0070_read_reg(state, 0x17); 144 144 145 - dib0070_write_reg(st, 0x17, value & 0xfffc); 146 - tmp = dib0070_read_reg(st, 0x01) & 0x01ff; 147 - dib0070_write_reg(st, 0x01, tmp | (60 << 9)); 145 + dib0070_write_reg(state, 0x17, value & 0xfffc); 146 + tmp = dib0070_read_reg(state, 0x01) & 0x01ff; 147 + dib0070_write_reg(state, 0x01, tmp | (60 << 9)); 148 148 149 - dib0070_write_reg(st, 0x17, value); 150 - } 149 + dib0070_write_reg(state, 0x17, value); 150 + } 151 151 return 0; 152 152 } 153 153 154 - static int dib0070_captrim(struct dib0070_state *st, enum frontend_tune_state *tune_state) 154 + static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state *tune_state) 155 155 { 156 156 int8_t step_sign; 157 157 u16 adc; ··· 159 159 160 160 if (*tune_state == CT_TUNER_STEP_0) { 161 161 162 - dib0070_write_reg(st, 0x0f, 0xed10); 163 - dib0070_write_reg(st, 0x17, 0x0034); 162 + dib0070_write_reg(state, 0x0f, 0xed10); 163 + dib0070_write_reg(state, 0x17, 0x0034); 164 164 165 - dib0070_write_reg(st, 0x18, 0x0032); 166 - st->step = st->captrim = st->fcaptrim = 64; 167 - st->adc_diff = 3000; 165 + dib0070_write_reg(state, 0x18, 0x0032); 166 + state->step = state->captrim = state->fcaptrim = 64; 167 + state->adc_diff = 3000; 168 168 ret = 20; 169 169 170 - *tune_state = CT_TUNER_STEP_1; 170 + *tune_state = CT_TUNER_STEP_1; 171 171 } else if (*tune_state == CT_TUNER_STEP_1) { 172 - st->step /= 2; 173 - dib0070_write_reg(st, 0x14, st->lo4 | st->captrim); 172 + state->step /= 2; 173 + dib0070_write_reg(state, 0x14, state->lo4 | state->captrim); 174 174 ret = 15; 175 175 176 176 *tune_state = CT_TUNER_STEP_2; 177 177 } else if (*tune_state == CT_TUNER_STEP_2) { 178 178 179 - adc = dib0070_read_reg(st, 0x19); 179 + adc = dib0070_read_reg(state, 0x19); 180 180 181 - dprintk( "CAPTRIM=%hd; ADC = %hd (ADC) & %dmV", st->captrim, adc, (u32) adc*(u32)1800/(u32)1024); 181 + dprintk("CAPTRIM=%hd; ADC = %hd (ADC) & %dmV", state->captrim, adc, (u32) adc * (u32) 1800 / (u32) 1024); 182 182 183 183 if (adc >= 400) { 184 184 adc -= 400; ··· 188 188 step_sign = 1; 189 189 } 190 190 191 - if (adc < st->adc_diff) { 192 - dprintk( "CAPTRIM=%hd is closer to target (%hd/%hd)", st->captrim, adc, st->adc_diff); 193 - st->adc_diff = adc; 194 - st->fcaptrim = st->captrim; 195 - 196 - 191 + if (adc < state->adc_diff) { 192 + dprintk("CAPTRIM=%hd is closer to target (%hd/%hd)", state->captrim, adc, state->adc_diff); 193 + state->adc_diff = adc; 194 + state->fcaptrim = state->captrim; 197 195 198 196 } 199 - st->captrim += (step_sign * st->step); 197 + state->captrim += (step_sign * state->step); 200 198 201 - if (st->step >= 1) 199 + if (state->step >= 1) 202 200 *tune_state = CT_TUNER_STEP_1; 203 201 else 204 202 *tune_state = CT_TUNER_STEP_3; 205 203 206 204 } else if (*tune_state == CT_TUNER_STEP_3) { 207 - dib0070_write_reg(st, 0x14, st->lo4 | st->fcaptrim); 208 - dib0070_write_reg(st, 0x18, 0x07ff); 205 + dib0070_write_reg(state, 0x14, state->lo4 | state->fcaptrim); 206 + dib0070_write_reg(state, 0x18, 0x07ff); 209 207 *tune_state = CT_TUNER_STEP_4; 210 208 } 211 209 ··· 213 215 static int dib0070_set_ctrl_lo5(struct dvb_frontend *fe, u8 vco_bias_trim, u8 hf_div_trim, u8 cp_current, u8 third_order_filt) 214 216 { 215 217 struct dib0070_state *state = fe->tuner_priv; 216 - u16 lo5 = (third_order_filt << 14) | (0 << 13) | (1 << 12) | (3 << 9) | (cp_current << 6) | (hf_div_trim << 3) | (vco_bias_trim << 0); 217 - dprintk( "CTRL_LO5: 0x%x", lo5); 218 + u16 lo5 = (third_order_filt << 14) | (0 << 13) | (1 << 12) | (3 << 9) | (cp_current << 6) | (hf_div_trim << 3) | (vco_bias_trim << 0); 219 + dprintk("CTRL_LO5: 0x%x", lo5); 218 220 return dib0070_write_reg(state, 0x15, lo5); 219 221 } 220 222 221 - struct dib0070_tuning 223 + void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open) 222 224 { 223 - u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */ 224 - u8 switch_trim; 225 - u8 vco_band; 226 - u8 hfdiv; 227 - u8 vco_multi; 228 - u8 presc; 229 - u8 wbdmux; 230 - u16 tuner_enable; 231 - }; 225 + struct dib0070_state *state = fe->tuner_priv; 232 226 233 - struct dib0070_lna_match 234 - { 235 - u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */ 236 - u8 lna_band; 237 - }; 238 - 239 - static const struct dib0070_tuning dib0070s_tuning_table[] = 240 - 241 - { 242 - { 570000, 2, 1, 3, 6, 6, 2, 0x4000 | 0x0800 }, /* UHF */ 243 - { 700000, 2, 0, 2, 4, 2, 2, 0x4000 | 0x0800 }, 244 - { 863999, 2, 1, 2, 4, 2, 2, 0x4000 | 0x0800 }, 245 - { 1500000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND */ 246 - { 1600000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 }, 247 - { 2000000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 }, 248 - { 0xffffffff, 0, 0, 8, 1, 2, 1, 0x8000 | 0x1000 }, /* SBAND */ 249 - }; 250 - 251 - static const struct dib0070_tuning dib0070_tuning_table[] = 252 - 253 - { 254 - { 115000, 1, 0, 7, 24, 2, 1, 0x8000 | 0x1000 }, /* FM below 92MHz cannot be tuned */ 255 - { 179500, 1, 0, 3, 16, 2, 1, 0x8000 | 0x1000 }, /* VHF */ 256 - { 189999, 1, 1, 3, 16, 2, 1, 0x8000 | 0x1000 }, 257 - { 250000, 1, 0, 6, 12, 2, 1, 0x8000 | 0x1000 }, 258 - { 569999, 2, 1, 5, 6, 2, 2, 0x4000 | 0x0800 }, /* UHF */ 259 - { 699999, 2, 0 ,1, 4, 2, 2, 0x4000 | 0x0800 }, 260 - { 863999, 2, 1, 1, 4, 2, 2, 0x4000 | 0x0800 }, 261 - { 0xffffffff, 0, 1, 0, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND or everything higher than UHF */ 262 - }; 263 - 264 - static const struct dib0070_lna_match dib0070_lna_flip_chip[] = 265 - 266 - { 267 - { 180000, 0 }, /* VHF */ 268 - { 188000, 1 }, 269 - { 196400, 2 }, 270 - { 250000, 3 }, 271 - { 550000, 0 }, /* UHF */ 272 - { 590000, 1 }, 273 - { 666000, 3 }, 274 - { 864000, 5 }, 275 - { 1500000, 0 }, /* LBAND or everything higher than UHF */ 276 - { 1600000, 1 }, 277 - { 2000000, 3 }, 278 - { 0xffffffff, 7 }, 279 - }; 280 - 281 - static const struct dib0070_lna_match dib0070_lna[] = 282 - 283 - { 284 - { 180000, 0 }, /* VHF */ 285 - { 188000, 1 }, 286 - { 196400, 2 }, 287 - { 250000, 3 }, 288 - { 550000, 2 }, /* UHF */ 289 - { 650000, 3 }, 290 - { 750000, 5 }, 291 - { 850000, 6 }, 292 - { 864000, 7 }, 293 - { 1500000, 0 }, /* LBAND or everything higher than UHF */ 294 - { 1600000, 1 }, 295 - { 2000000, 3 }, 296 - { 0xffffffff, 7 }, 297 - }; 298 - 299 - #define LPF 100 // define for the loop filter 100kHz by default 16-07-06 300 - static int dib0070_tune_digital(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch) 301 - { 302 - struct dib0070_state *st = fe->tuner_priv; 303 - 304 - const struct dib0070_tuning *tune; 305 - const struct dib0070_lna_match *lna_match; 306 - 307 - enum frontend_tune_state *tune_state = &st->tune_state; 308 - int ret = 10; /* 1ms is the default delay most of the time */ 309 - 310 - u8 band = (u8)BAND_OF_FREQUENCY(ch->frequency/1000); 311 - u32 freq = ch->frequency/1000 + (band == BAND_VHF ? st->cfg->freq_offset_khz_vhf : st->cfg->freq_offset_khz_uhf); 312 - 313 - 314 - 315 - 316 - 317 - #ifdef CONFIG_STANDARD_ISDBT 318 - if (fe->dtv_property_cache.delivery_system == SYS_ISDBT && ch->u.isdbt.sb_mode == 1) 319 - if ( ( (ch->u.isdbt.sb_conn_total_seg % 2) && (ch->u.isdbt.sb_wanted_seg == ((ch->u.isdbt.sb_conn_total_seg/2) + 1) ) ) || 320 - ( ( (ch->u.isdbt.sb_conn_total_seg % 2) == 0) && (ch->u.isdbt.sb_wanted_seg == (ch->u.isdbt.sb_conn_total_seg/2) ) ) || 321 - ( ( (ch->u.isdbt.sb_conn_total_seg % 2) == 0) && (ch->u.isdbt.sb_wanted_seg == ((ch->u.isdbt.sb_conn_total_seg/2)+1))) ) 322 - freq += 850; 323 - #endif 324 - if (st->current_rf != freq) { 325 - 326 - switch (st->revision) { 327 - case DIB0070S_P1A: 328 - tune = dib0070s_tuning_table; 329 - lna_match = dib0070_lna; 330 - break; 331 - default: 332 - tune = dib0070_tuning_table; 333 - if (st->cfg->flip_chip) 334 - lna_match = dib0070_lna_flip_chip; 335 - else 336 - lna_match = dib0070_lna; 337 - break; 338 - } 339 - while (freq > tune->max_freq) /* find the right one */ 340 - tune++; 341 - while (freq > lna_match->max_freq) /* find the right one */ 342 - lna_match++; 343 - 344 - st->current_tune_table_index = tune; 345 - st->lna_match = lna_match; 346 - } 347 - 348 - if (*tune_state == CT_TUNER_START) { 349 - dprintk( "Tuning for Band: %hd (%d kHz)", band, freq); 350 - if (st->current_rf != freq) { 351 - u8 REFDIV; 352 - u32 FBDiv, Rest, FREF, VCOF_kHz; 353 - u8 Den; 354 - 355 - st->current_rf = freq; 356 - st->lo4 = (st->current_tune_table_index->vco_band << 11) | (st->current_tune_table_index->hfdiv << 7); 357 - 358 - 359 - dib0070_write_reg(st, 0x17, 0x30); 360 - 361 - 362 - VCOF_kHz = st->current_tune_table_index->vco_multi * freq * 2; 363 - 364 - switch (band) { 365 - case BAND_VHF: 366 - REFDIV = (u8) ((st->cfg->clock_khz + 9999) / 10000); 367 - break; 368 - case BAND_FM: 369 - REFDIV = (u8) ((st->cfg->clock_khz) / 1000); 370 - break; 371 - default: 372 - REFDIV = (u8) ( st->cfg->clock_khz / 10000); 373 - break; 374 - } 375 - FREF = st->cfg->clock_khz / REFDIV; 376 - 377 - 378 - 379 - switch (st->revision) { 380 - case DIB0070S_P1A: 381 - FBDiv = (VCOF_kHz / st->current_tune_table_index->presc / FREF); 382 - Rest = (VCOF_kHz / st->current_tune_table_index->presc) - FBDiv * FREF; 383 - break; 384 - 385 - case DIB0070_P1G: 386 - case DIB0070_P1F: 387 - default: 388 - FBDiv = (freq / (FREF / 2)); 389 - Rest = 2 * freq - FBDiv * FREF; 390 - break; 391 - } 392 - 393 - 394 - if (Rest < LPF) Rest = 0; 395 - else if (Rest < 2 * LPF) Rest = 2 * LPF; 396 - else if (Rest > (FREF - LPF)) { Rest = 0 ; FBDiv += 1; } 397 - else if (Rest > (FREF - 2 * LPF)) Rest = FREF - 2 * LPF; 398 - Rest = (Rest * 6528) / (FREF / 10); 399 - 400 - Den = 1; 401 - if (Rest > 0) { 402 - st->lo4 |= (1 << 14) | (1 << 12); 403 - Den = 255; 404 - } 405 - 406 - 407 - dib0070_write_reg(st, 0x11, (u16)FBDiv); 408 - dib0070_write_reg(st, 0x12, (Den << 8) | REFDIV); 409 - dib0070_write_reg(st, 0x13, (u16) Rest); 410 - 411 - if (st->revision == DIB0070S_P1A) { 412 - 413 - if (band == BAND_SBAND) { 414 - dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0); 415 - dib0070_write_reg(st, 0x1d,0xFFFF); 416 - } else 417 - dib0070_set_ctrl_lo5(fe, 5, 4, 3, 1); 418 - } 419 - 420 - 421 - dib0070_write_reg(st, 0x20, 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001 | st->current_tune_table_index->tuner_enable); 422 - 423 - dprintk( "REFDIV: %hd, FREF: %d", REFDIV, FREF); 424 - dprintk( "FBDIV: %d, Rest: %d", FBDiv, Rest); 425 - dprintk( "Num: %hd, Den: %hd, SD: %hd",(u16) Rest, Den, (st->lo4 >> 12) & 0x1); 426 - dprintk( "HFDIV code: %hd", st->current_tune_table_index->hfdiv); 427 - dprintk( "VCO = %hd", st->current_tune_table_index->vco_band); 428 - dprintk( "VCOF: ((%hd*%d) << 1))", st->current_tune_table_index->vco_multi, freq); 429 - 430 - *tune_state = CT_TUNER_STEP_0; 431 - } else { /* we are already tuned to this frequency - the configuration is correct */ 432 - ret = 50; /* wakeup time */ 433 - *tune_state = CT_TUNER_STEP_5; 434 - } 435 - } else if ((*tune_state > CT_TUNER_START) && (*tune_state < CT_TUNER_STEP_4)) { 436 - 437 - ret = dib0070_captrim(st, tune_state); 438 - 439 - } else if (*tune_state == CT_TUNER_STEP_4) { 440 - const struct dib0070_wbd_gain_cfg *tmp = st->cfg->wbd_gain; 441 - if (tmp != NULL) { 442 - while (freq/1000 > tmp->freq) /* find the right one */ 443 - tmp++; 444 - dib0070_write_reg(st, 0x0f, (0 << 15) | (1 << 14) | (3 << 12) | (tmp->wbd_gain_val << 9) | (0 << 8) | (1 << 7) | (st->current_tune_table_index->wbdmux << 0)); 445 - st->wbd_gain_current = tmp->wbd_gain_val; 227 + if (open) { 228 + dib0070_write_reg(state, 0x1b, 0xff00); 229 + dib0070_write_reg(state, 0x1a, 0x0000); 446 230 } else { 447 - dib0070_write_reg(st, 0x0f, (0 << 15) | (1 << 14) | (3 << 12) | (6 << 9) | (0 << 8) | (1 << 7) | (st->current_tune_table_index->wbdmux << 0)); 448 - st->wbd_gain_current = 6; 231 + dib0070_write_reg(state, 0x1b, 0x4112); 232 + if (state->cfg->vga_filter != 0) { 233 + dib0070_write_reg(state, 0x1a, state->cfg->vga_filter); 234 + dprintk("vga filter register is set to %x", state->cfg->vga_filter); 235 + } else 236 + dib0070_write_reg(state, 0x1a, 0x0009); 449 237 } 450 - 451 - dib0070_write_reg(st, 0x06, 0x3fff); 452 - dib0070_write_reg(st, 0x07, (st->current_tune_table_index->switch_trim << 11) | (7 << 8) | (st->lna_match->lna_band << 3) | (3 << 0)); 453 - dib0070_write_reg(st, 0x08, (st->lna_match->lna_band << 10) | (3 << 7) | (127)); 454 - dib0070_write_reg(st, 0x0d, 0x0d80); 455 - 456 - 457 - dib0070_write_reg(st, 0x18, 0x07ff); 458 - dib0070_write_reg(st, 0x17, 0x0033); 459 - 460 - 461 - *tune_state = CT_TUNER_STEP_5; 462 - } else if (*tune_state == CT_TUNER_STEP_5) { 463 - dib0070_set_bandwidth(fe, ch); 464 - *tune_state = CT_TUNER_STOP; 465 - } else { 466 - ret = FE_CALLBACK_TIME_NEVER; /* tuner finished, time to call again infinite */ 467 - } 468 - return ret; 469 238 } 470 239 240 + EXPORT_SYMBOL(dib0070_ctrl_agc_filter); 241 + struct dib0070_tuning { 242 + u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */ 243 + u8 switch_trim; 244 + u8 vco_band; 245 + u8 hfdiv; 246 + u8 vco_multi; 247 + u8 presc; 248 + u8 wbdmux; 249 + u16 tuner_enable; 250 + }; 251 + 252 + struct dib0070_lna_match { 253 + u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */ 254 + u8 lna_band; 255 + }; 256 + 257 + static const struct dib0070_tuning dib0070s_tuning_table[] = { 258 + {570000, 2, 1, 3, 6, 6, 2, 0x4000 | 0x0800}, /* UHF */ 259 + {700000, 2, 0, 2, 4, 2, 2, 0x4000 | 0x0800}, 260 + {863999, 2, 1, 2, 4, 2, 2, 0x4000 | 0x0800}, 261 + {1500000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400}, /* LBAND */ 262 + {1600000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400}, 263 + {2000000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400}, 264 + {0xffffffff, 0, 0, 8, 1, 2, 1, 0x8000 | 0x1000}, /* SBAND */ 265 + }; 266 + 267 + static const struct dib0070_tuning dib0070_tuning_table[] = { 268 + {115000, 1, 0, 7, 24, 2, 1, 0x8000 | 0x1000}, /* FM below 92MHz cannot be tuned */ 269 + {179500, 1, 0, 3, 16, 2, 1, 0x8000 | 0x1000}, /* VHF */ 270 + {189999, 1, 1, 3, 16, 2, 1, 0x8000 | 0x1000}, 271 + {250000, 1, 0, 6, 12, 2, 1, 0x8000 | 0x1000}, 272 + {569999, 2, 1, 5, 6, 2, 2, 0x4000 | 0x0800}, /* UHF */ 273 + {699999, 2, 0, 1, 4, 2, 2, 0x4000 | 0x0800}, 274 + {863999, 2, 1, 1, 4, 2, 2, 0x4000 | 0x0800}, 275 + {0xffffffff, 0, 1, 0, 2, 2, 4, 0x2000 | 0x0400}, /* LBAND or everything higher than UHF */ 276 + }; 277 + 278 + static const struct dib0070_lna_match dib0070_lna_flip_chip[] = { 279 + {180000, 0}, /* VHF */ 280 + {188000, 1}, 281 + {196400, 2}, 282 + {250000, 3}, 283 + {550000, 0}, /* UHF */ 284 + {590000, 1}, 285 + {666000, 3}, 286 + {864000, 5}, 287 + {1500000, 0}, /* LBAND or everything higher than UHF */ 288 + {1600000, 1}, 289 + {2000000, 3}, 290 + {0xffffffff, 7}, 291 + }; 292 + 293 + static const struct dib0070_lna_match dib0070_lna[] = { 294 + {180000, 0}, /* VHF */ 295 + {188000, 1}, 296 + {196400, 2}, 297 + {250000, 3}, 298 + {550000, 2}, /* UHF */ 299 + {650000, 3}, 300 + {750000, 5}, 301 + {850000, 6}, 302 + {864000, 7}, 303 + {1500000, 0}, /* LBAND or everything higher than UHF */ 304 + {1600000, 1}, 305 + {2000000, 3}, 306 + {0xffffffff, 7}, 307 + }; 308 + 309 + #define LPF 100 // define for the loop filter 100kHz by default 16-07-06 310 + static int dib0070_tune_digital(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch) 311 + { 312 + struct dib0070_state *state = fe->tuner_priv; 313 + 314 + const struct dib0070_tuning *tune; 315 + const struct dib0070_lna_match *lna_match; 316 + 317 + enum frontend_tune_state *tune_state = &state->tune_state; 318 + int ret = 10; /* 1ms is the default delay most of the time */ 319 + 320 + u8 band = (u8) BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency / 1000); 321 + u32 freq = fe->dtv_property_cache.frequency / 1000 + (band == BAND_VHF ? state->cfg->freq_offset_khz_vhf : state->cfg->freq_offset_khz_uhf); 322 + 323 + #ifdef CONFIG_SYS_ISDBT 324 + if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT && state->fe->dtv_property_cache.isdbt_sb_mode == 1) 325 + if (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) 326 + && (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1))) 327 + || (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0) 328 + && (state->fe->dtv_property_cache.isdbt_sb_segment_idx == (state->fe->dtv_property_cache.isdbt_sb_segment_count / 2))) 329 + || (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0) 330 + && (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1)))) 331 + freq += 850; 332 + #endif 333 + if (state->current_rf != freq) { 334 + 335 + switch (state->revision) { 336 + case DIB0070S_P1A: 337 + tune = dib0070s_tuning_table; 338 + lna_match = dib0070_lna; 339 + break; 340 + default: 341 + tune = dib0070_tuning_table; 342 + if (state->cfg->flip_chip) 343 + lna_match = dib0070_lna_flip_chip; 344 + else 345 + lna_match = dib0070_lna; 346 + break; 347 + } 348 + while (freq > tune->max_freq) /* find the right one */ 349 + tune++; 350 + while (freq > lna_match->max_freq) /* find the right one */ 351 + lna_match++; 352 + 353 + state->current_tune_table_index = tune; 354 + state->lna_match = lna_match; 355 + } 356 + 357 + if (*tune_state == CT_TUNER_START) { 358 + dprintk("Tuning for Band: %hd (%d kHz)", band, freq); 359 + if (state->current_rf != freq) { 360 + u8 REFDIV; 361 + u32 FBDiv, Rest, FREF, VCOF_kHz; 362 + u8 Den; 363 + 364 + state->current_rf = freq; 365 + state->lo4 = (state->current_tune_table_index->vco_band << 11) | (state->current_tune_table_index->hfdiv << 7); 366 + 367 + dib0070_write_reg(state, 0x17, 0x30); 368 + 369 + VCOF_kHz = state->current_tune_table_index->vco_multi * freq * 2; 370 + 371 + switch (band) { 372 + case BAND_VHF: 373 + REFDIV = (u8) ((state->cfg->clock_khz + 9999) / 10000); 374 + break; 375 + case BAND_FM: 376 + REFDIV = (u8) ((state->cfg->clock_khz) / 1000); 377 + break; 378 + default: 379 + REFDIV = (u8) (state->cfg->clock_khz / 10000); 380 + break; 381 + } 382 + FREF = state->cfg->clock_khz / REFDIV; 383 + 384 + switch (state->revision) { 385 + case DIB0070S_P1A: 386 + FBDiv = (VCOF_kHz / state->current_tune_table_index->presc / FREF); 387 + Rest = (VCOF_kHz / state->current_tune_table_index->presc) - FBDiv * FREF; 388 + break; 389 + 390 + case DIB0070_P1G: 391 + case DIB0070_P1F: 392 + default: 393 + FBDiv = (freq / (FREF / 2)); 394 + Rest = 2 * freq - FBDiv * FREF; 395 + break; 396 + } 397 + 398 + if (Rest < LPF) 399 + Rest = 0; 400 + else if (Rest < 2 * LPF) 401 + Rest = 2 * LPF; 402 + else if (Rest > (FREF - LPF)) { 403 + Rest = 0; 404 + FBDiv += 1; 405 + } else if (Rest > (FREF - 2 * LPF)) 406 + Rest = FREF - 2 * LPF; 407 + Rest = (Rest * 6528) / (FREF / 10); 408 + 409 + Den = 1; 410 + if (Rest > 0) { 411 + state->lo4 |= (1 << 14) | (1 << 12); 412 + Den = 255; 413 + } 414 + 415 + dib0070_write_reg(state, 0x11, (u16) FBDiv); 416 + dib0070_write_reg(state, 0x12, (Den << 8) | REFDIV); 417 + dib0070_write_reg(state, 0x13, (u16) Rest); 418 + 419 + if (state->revision == DIB0070S_P1A) { 420 + 421 + if (band == BAND_SBAND) { 422 + dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0); 423 + dib0070_write_reg(state, 0x1d, 0xFFFF); 424 + } else 425 + dib0070_set_ctrl_lo5(fe, 5, 4, 3, 1); 426 + } 427 + 428 + dib0070_write_reg(state, 0x20, 429 + 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001 | state->current_tune_table_index->tuner_enable); 430 + 431 + dprintk("REFDIV: %hd, FREF: %d", REFDIV, FREF); 432 + dprintk("FBDIV: %d, Rest: %d", FBDiv, Rest); 433 + dprintk("Num: %hd, Den: %hd, SD: %hd", (u16) Rest, Den, (state->lo4 >> 12) & 0x1); 434 + dprintk("HFDIV code: %hd", state->current_tune_table_index->hfdiv); 435 + dprintk("VCO = %hd", state->current_tune_table_index->vco_band); 436 + dprintk("VCOF: ((%hd*%d) << 1))", state->current_tune_table_index->vco_multi, freq); 437 + 438 + *tune_state = CT_TUNER_STEP_0; 439 + } else { /* we are already tuned to this frequency - the configuration is correct */ 440 + ret = 50; /* wakeup time */ 441 + *tune_state = CT_TUNER_STEP_5; 442 + } 443 + } else if ((*tune_state > CT_TUNER_START) && (*tune_state < CT_TUNER_STEP_4)) { 444 + 445 + ret = dib0070_captrim(state, tune_state); 446 + 447 + } else if (*tune_state == CT_TUNER_STEP_4) { 448 + const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain; 449 + if (tmp != NULL) { 450 + while (freq / 1000 > tmp->freq) /* find the right one */ 451 + tmp++; 452 + dib0070_write_reg(state, 0x0f, 453 + (0 << 15) | (1 << 14) | (3 << 12) | (tmp->wbd_gain_val << 9) | (0 << 8) | (1 << 7) | (state-> 454 + current_tune_table_index-> 455 + wbdmux << 0)); 456 + state->wbd_gain_current = tmp->wbd_gain_val; 457 + } else { 458 + dib0070_write_reg(state, 0x0f, 459 + (0 << 15) | (1 << 14) | (3 << 12) | (6 << 9) | (0 << 8) | (1 << 7) | (state->current_tune_table_index-> 460 + wbdmux << 0)); 461 + state->wbd_gain_current = 6; 462 + } 463 + 464 + dib0070_write_reg(state, 0x06, 0x3fff); 465 + dib0070_write_reg(state, 0x07, 466 + (state->current_tune_table_index->switch_trim << 11) | (7 << 8) | (state->lna_match->lna_band << 3) | (3 << 0)); 467 + dib0070_write_reg(state, 0x08, (state->lna_match->lna_band << 10) | (3 << 7) | (127)); 468 + dib0070_write_reg(state, 0x0d, 0x0d80); 469 + 470 + dib0070_write_reg(state, 0x18, 0x07ff); 471 + dib0070_write_reg(state, 0x17, 0x0033); 472 + 473 + *tune_state = CT_TUNER_STEP_5; 474 + } else if (*tune_state == CT_TUNER_STEP_5) { 475 + dib0070_set_bandwidth(fe, ch); 476 + *tune_state = CT_TUNER_STOP; 477 + } else { 478 + ret = FE_CALLBACK_TIME_NEVER; /* tuner finished, time to call again infinite */ 479 + } 480 + return ret; 481 + } 471 482 472 483 static int dib0070_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) 473 484 { 474 - struct dib0070_state *state = fe->tuner_priv; 475 - uint32_t ret; 485 + struct dib0070_state *state = fe->tuner_priv; 486 + uint32_t ret; 476 487 477 - state->tune_state = CT_TUNER_START; 488 + state->tune_state = CT_TUNER_START; 478 489 479 - do { 480 - ret = dib0070_tune_digital(fe, p); 481 - if (ret != FE_CALLBACK_TIME_NEVER) 482 - msleep(ret/10); 483 - else 484 - break; 485 - } while (state->tune_state != CT_TUNER_STOP); 490 + do { 491 + ret = dib0070_tune_digital(fe, p); 492 + if (ret != FE_CALLBACK_TIME_NEVER) 493 + msleep(ret / 10); 494 + else 495 + break; 496 + } while (state->tune_state != CT_TUNER_STOP); 486 497 487 - return 0; 498 + return 0; 488 499 } 489 500 490 501 static int dib0070_wakeup(struct dvb_frontend *fe) 491 502 { 492 - struct dib0070_state *st = fe->tuner_priv; 493 - if (st->cfg->sleep) 494 - st->cfg->sleep(fe, 0); 503 + struct dib0070_state *state = fe->tuner_priv; 504 + if (state->cfg->sleep) 505 + state->cfg->sleep(fe, 0); 495 506 return 0; 496 507 } 497 508 498 509 static int dib0070_sleep(struct dvb_frontend *fe) 499 510 { 500 - struct dib0070_state *st = fe->tuner_priv; 501 - if (st->cfg->sleep) 502 - st->cfg->sleep(fe, 1); 511 + struct dib0070_state *state = fe->tuner_priv; 512 + if (state->cfg->sleep) 513 + state->cfg->sleep(fe, 1); 503 514 return 0; 504 515 } 505 516 506 - static const u16 dib0070_p1f_defaults[] = 507 - 508 - { 517 + static const u16 dib0070_p1f_defaults[] = { 509 518 7, 0x02, 510 - 0x0008, 511 - 0x0000, 512 - 0x0000, 513 - 0x0000, 514 - 0x0000, 515 - 0x0002, 516 - 0x0100, 519 + 0x0008, 520 + 0x0000, 521 + 0x0000, 522 + 0x0000, 523 + 0x0000, 524 + 0x0002, 525 + 0x0100, 517 526 518 527 3, 0x0d, 519 - 0x0d80, 520 - 0x0001, 521 - 0x0000, 528 + 0x0d80, 529 + 0x0001, 530 + 0x0000, 522 531 523 532 4, 0x11, 524 - 0x0000, 525 - 0x0103, 526 - 0x0000, 527 - 0x0000, 533 + 0x0000, 534 + 0x0103, 535 + 0x0000, 536 + 0x0000, 528 537 529 538 3, 0x16, 530 - 0x0004 | 0x0040, 531 - 0x0030, 532 - 0x07ff, 539 + 0x0004 | 0x0040, 540 + 0x0030, 541 + 0x07ff, 533 542 534 543 6, 0x1b, 535 - 0x4112, 536 - 0xff00, 537 - 0xc07f, 538 - 0x0000, 539 - 0x0180, 540 - 0x4000 | 0x0800 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001, 544 + 0x4112, 545 + 0xff00, 546 + 0xc07f, 547 + 0x0000, 548 + 0x0180, 549 + 0x4000 | 0x0800 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001, 541 550 542 551 0, 543 552 }; 544 553 545 554 static u16 dib0070_read_wbd_offset(struct dib0070_state *state, u8 gain) 546 555 { 547 - u16 tuner_en = dib0070_read_reg(state, 0x20); 548 - u16 offset; 556 + u16 tuner_en = dib0070_read_reg(state, 0x20); 557 + u16 offset; 549 558 550 - dib0070_write_reg(state, 0x18, 0x07ff); 551 - dib0070_write_reg(state, 0x20, 0x0800 | 0x4000 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001); 552 - dib0070_write_reg(state, 0x0f, (1 << 14) | (2 << 12) | (gain << 9) | (1 << 8) | (1 << 7) | (0 << 0)); 553 - msleep(9); 554 - offset = dib0070_read_reg(state, 0x19); 555 - dib0070_write_reg(state, 0x20, tuner_en); 556 - return offset; 559 + dib0070_write_reg(state, 0x18, 0x07ff); 560 + dib0070_write_reg(state, 0x20, 0x0800 | 0x4000 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001); 561 + dib0070_write_reg(state, 0x0f, (1 << 14) | (2 << 12) | (gain << 9) | (1 << 8) | (1 << 7) | (0 << 0)); 562 + msleep(9); 563 + offset = dib0070_read_reg(state, 0x19); 564 + dib0070_write_reg(state, 0x20, tuner_en); 565 + return offset; 557 566 } 558 567 559 568 static void dib0070_wbd_offset_calibration(struct dib0070_state *state) 560 569 { 561 - u8 gain; 562 - for (gain = 6; gain < 8; gain++) { 563 - state->wbd_offset_3_3[gain - 6] = ((dib0070_read_wbd_offset(state, gain) * 8 * 18 / 33 + 1) / 2); 564 - dprintk( "Gain: %d, WBDOffset (3.3V) = %hd", gain, state->wbd_offset_3_3[gain-6]); 565 - } 570 + u8 gain; 571 + for (gain = 6; gain < 8; gain++) { 572 + state->wbd_offset_3_3[gain - 6] = ((dib0070_read_wbd_offset(state, gain) * 8 * 18 / 33 + 1) / 2); 573 + dprintk("Gain: %d, WBDOffset (3.3V) = %hd", gain, state->wbd_offset_3_3[gain - 6]); 574 + } 566 575 } 567 576 568 577 u16 dib0070_wbd_offset(struct dvb_frontend *fe) 569 578 { 570 - struct dib0070_state *st = fe->tuner_priv; 571 - return st->wbd_offset_3_3[st->wbd_gain_current - 6]; 579 + struct dib0070_state *state = fe->tuner_priv; 580 + const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain; 581 + u32 freq = fe->dtv_property_cache.frequency / 1000; 582 + 583 + if (tmp != NULL) { 584 + while (freq / 1000 > tmp->freq) /* find the right one */ 585 + tmp++; 586 + state->wbd_gain_current = tmp->wbd_gain_val; 587 + } else 588 + state->wbd_gain_current = 6; 589 + 590 + return state->wbd_offset_3_3[state->wbd_gain_current - 6]; 572 591 } 573 592 574 593 EXPORT_SYMBOL(dib0070_wbd_offset); 594 + 575 595 #define pgm_read_word(w) (*w) 576 596 static int dib0070_reset(struct dvb_frontend *fe) 577 597 { 578 - struct dib0070_state *state = fe->tuner_priv; 598 + struct dib0070_state *state = fe->tuner_priv; 579 599 u16 l, r, *n; 580 600 581 601 HARD_RESET(state); 582 - 583 602 584 603 #ifndef FORCE_SBAND_TUNER 585 604 if ((dib0070_read_reg(state, 0x22) >> 9) & 0x1) ··· 605 590 #else 606 591 #warning forcing SBAND 607 592 #endif 608 - state->revision = DIB0070S_P1A; 593 + state->revision = DIB0070S_P1A; 609 594 610 595 /* P1F or not */ 611 - dprintk( "Revision: %x", state->revision); 596 + dprintk("Revision: %x", state->revision); 612 597 613 598 if (state->revision == DIB0070_P1D) { 614 - dprintk( "Error: this driver is not to be used meant for P1D or earlier"); 599 + dprintk("Error: this driver is not to be used meant for P1D or earlier"); 615 600 return -EINVAL; 616 601 } 617 602 ··· 620 605 while (l) { 621 606 r = pgm_read_word(n++); 622 607 do { 623 - dib0070_write_reg(state, (u8)r, pgm_read_word(n++)); 608 + dib0070_write_reg(state, (u8) r, pgm_read_word(n++)); 624 609 r++; 625 610 } while (--l); 626 611 l = pgm_read_word(n++); ··· 633 618 else 634 619 r = 2; 635 620 636 - 637 621 r |= state->cfg->osc_buffer_state << 3; 638 622 639 623 dib0070_write_reg(state, 0x10, r); ··· 643 629 dib0070_write_reg(state, 0x02, r | (1 << 5)); 644 630 } 645 631 646 - if (state->revision == DIB0070S_P1A) 647 - dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0); 648 - else 632 + if (state->revision == DIB0070S_P1A) 633 + dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0); 634 + else 649 635 dib0070_set_ctrl_lo5(fe, 5, 4, state->cfg->charge_pump, state->cfg->enable_third_order_filter); 650 636 651 637 dib0070_write_reg(state, 0x01, (54 << 9) | 0xc8); 652 638 653 - dib0070_wbd_offset_calibration(state); 639 + dib0070_wbd_offset_calibration(state); 654 640 655 - return 0; 641 + return 0; 656 642 } 657 - 658 643 659 644 static int dib0070_release(struct dvb_frontend *fe) 660 645 { ··· 664 651 665 652 static const struct dvb_tuner_ops dib0070_ops = { 666 653 .info = { 667 - .name = "DiBcom DiB0070", 668 - .frequency_min = 45000000, 669 - .frequency_max = 860000000, 670 - .frequency_step = 1000, 671 - }, 672 - .release = dib0070_release, 654 + .name = "DiBcom DiB0070", 655 + .frequency_min = 45000000, 656 + .frequency_max = 860000000, 657 + .frequency_step = 1000, 658 + }, 659 + .release = dib0070_release, 673 660 674 - .init = dib0070_wakeup, 675 - .sleep = dib0070_sleep, 676 - .set_params = dib0070_tune, 661 + .init = dib0070_wakeup, 662 + .sleep = dib0070_sleep, 663 + .set_params = dib0070_tune, 677 664 678 - // .get_frequency = dib0070_get_frequency, 679 - // .get_bandwidth = dib0070_get_bandwidth 665 + // .get_frequency = dib0070_get_frequency, 666 + // .get_bandwidth = dib0070_get_bandwidth 680 667 }; 681 668 682 - struct dvb_frontend * dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) 669 + struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) 683 670 { 684 671 struct dib0070_state *state = kzalloc(sizeof(struct dib0070_state), GFP_KERNEL); 685 672 if (state == NULL) ··· 687 674 688 675 state->cfg = cfg; 689 676 state->i2c = i2c; 690 - state->fe = fe; 677 + state->fe = fe; 691 678 fe->tuner_priv = state; 692 679 693 680 if (dib0070_reset(fe) != 0) ··· 699 686 fe->tuner_priv = state; 700 687 return fe; 701 688 702 - free_mem: 689 + free_mem: 703 690 kfree(state); 704 691 fe->tuner_priv = NULL; 705 692 return NULL; 706 693 } 694 + 707 695 EXPORT_SYMBOL(dib0070_attach); 708 696 709 697 MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>");
+14 -17
drivers/media/dvb/frontends/dib0070.h
··· 16 16 #define DEFAULT_DIB0070_I2C_ADDRESS 0x60 17 17 18 18 struct dib0070_wbd_gain_cfg { 19 - u16 freq; 20 - u16 wbd_gain_val; 19 + u16 freq; 20 + u16 wbd_gain_val; 21 21 }; 22 22 23 23 struct dib0070_config { ··· 31 31 int freq_offset_khz_uhf; 32 32 int freq_offset_khz_vhf; 33 33 34 - u8 osc_buffer_state; /* 0= normal, 1= tri-state */ 35 - u32 clock_khz; 36 - u8 clock_pad_drive; /* (Drive + 1) * 2mA */ 34 + u8 osc_buffer_state; /* 0= normal, 1= tri-state */ 35 + u32 clock_khz; 36 + u8 clock_pad_drive; /* (Drive + 1) * 2mA */ 37 37 38 - u8 invert_iq; /* invert Q - in case I or Q is inverted on the board */ 38 + u8 invert_iq; /* invert Q - in case I or Q is inverted on the board */ 39 39 40 - u8 force_crystal_mode; /* if == 0 -> decision is made in the driver default: <24 -> 2, >=24 -> 1 */ 40 + u8 force_crystal_mode; /* if == 0 -> decision is made in the driver default: <24 -> 2, >=24 -> 1 */ 41 41 42 42 u8 flip_chip; 43 - u8 enable_third_order_filter; 44 - u8 charge_pump; 43 + u8 enable_third_order_filter; 44 + u8 charge_pump; 45 45 46 - const struct dib0070_wbd_gain_cfg * wbd_gain; 46 + const struct dib0070_wbd_gain_cfg *wbd_gain; 47 47 48 - u8 vga_filter; 48 + u8 vga_filter; 49 49 }; 50 50 51 51 #if defined(CONFIG_DVB_TUNER_DIB0070) || (defined(CONFIG_DVB_TUNER_DIB0070_MODULE) && defined(MODULE)) 52 - extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, 53 - struct i2c_adapter *i2c, 54 - struct dib0070_config *cfg); 52 + extern struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg); 55 53 extern u16 dib0070_wbd_offset(struct dvb_frontend *); 56 54 #else 57 - static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, 58 - struct i2c_adapter *i2c, 59 - struct dib0070_config *cfg) 55 + static inline struct dvb_frontend *dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg) 60 56 { 61 57 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 62 58 return NULL; ··· 64 68 return -ENODEV; 65 69 } 66 70 #endif 71 + extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, u8 open); 67 72 68 73 #endif