| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | Driver for Philips tda10086 DVBS Demodulator |
|---|
| 3 | 4 | |
|---|
| 4 | 5 | (c) 2006 Andrew de Quincey |
|---|
| 5 | 6 | |
|---|
| 6 | | - This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - (at your option) any later version. |
|---|
| 10 | | - |
|---|
| 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 |
|---|
| 14 | | - |
|---|
| 15 | | - GNU General Public License for more details. |
|---|
| 16 | | - |
|---|
| 17 | | - You should have received a copy of the GNU General Public License |
|---|
| 18 | | - along with this program; if not, write to the Free Software |
|---|
| 19 | | - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | */ |
|---|
| 22 | 9 | |
|---|
| .. | .. |
|---|
| 30 | 17 | #include <media/dvb_frontend.h> |
|---|
| 31 | 18 | #include "tda10086.h" |
|---|
| 32 | 19 | |
|---|
| 33 | | -#define SACLK 96000000 |
|---|
| 20 | +#define SACLK 96000000U |
|---|
| 34 | 21 | |
|---|
| 35 | 22 | struct tda10086_state { |
|---|
| 36 | 23 | struct i2c_adapter* i2c; |
|---|
| .. | .. |
|---|
| 310 | 297 | dprintk ("%s %i\n", __func__, symbol_rate); |
|---|
| 311 | 298 | |
|---|
| 312 | 299 | /* setup the decimation and anti-aliasing filters.. */ |
|---|
| 313 | | - if (symbol_rate < (u32) (SACLK * 0.0137)) { |
|---|
| 300 | + if (symbol_rate < SACLK / 10000 * 137) { |
|---|
| 314 | 301 | dfn=4; |
|---|
| 315 | 302 | afs=1; |
|---|
| 316 | | - } else if (symbol_rate < (u32) (SACLK * 0.0208)) { |
|---|
| 303 | + } else if (symbol_rate < SACLK / 10000 * 208) { |
|---|
| 317 | 304 | dfn=4; |
|---|
| 318 | 305 | afs=0; |
|---|
| 319 | | - } else if (symbol_rate < (u32) (SACLK * 0.0270)) { |
|---|
| 306 | + } else if (symbol_rate < SACLK / 10000 * 270) { |
|---|
| 320 | 307 | dfn=3; |
|---|
| 321 | 308 | afs=1; |
|---|
| 322 | | - } else if (symbol_rate < (u32) (SACLK * 0.0416)) { |
|---|
| 309 | + } else if (symbol_rate < SACLK / 10000 * 416) { |
|---|
| 323 | 310 | dfn=3; |
|---|
| 324 | 311 | afs=0; |
|---|
| 325 | | - } else if (symbol_rate < (u32) (SACLK * 0.0550)) { |
|---|
| 312 | + } else if (symbol_rate < SACLK / 10000 * 550) { |
|---|
| 326 | 313 | dfn=2; |
|---|
| 327 | 314 | afs=1; |
|---|
| 328 | | - } else if (symbol_rate < (u32) (SACLK * 0.0833)) { |
|---|
| 315 | + } else if (symbol_rate < SACLK / 10000 * 833) { |
|---|
| 329 | 316 | dfn=2; |
|---|
| 330 | 317 | afs=0; |
|---|
| 331 | | - } else if (symbol_rate < (u32) (SACLK * 0.1100)) { |
|---|
| 318 | + } else if (symbol_rate < SACLK / 10000 * 1100) { |
|---|
| 332 | 319 | dfn=1; |
|---|
| 333 | 320 | afs=1; |
|---|
| 334 | | - } else if (symbol_rate < (u32) (SACLK * 0.1666)) { |
|---|
| 321 | + } else if (symbol_rate < SACLK / 10000 * 1666) { |
|---|
| 335 | 322 | dfn=1; |
|---|
| 336 | 323 | afs=0; |
|---|
| 337 | | - } else if (symbol_rate < (u32) (SACLK * 0.2200)) { |
|---|
| 324 | + } else if (symbol_rate < SACLK / 10000 * 2200) { |
|---|
| 338 | 325 | dfn=0; |
|---|
| 339 | 326 | afs=1; |
|---|
| 340 | | - } else if (symbol_rate < (u32) (SACLK * 0.3333)) { |
|---|
| 327 | + } else if (symbol_rate < SACLK / 10000 * 3333) { |
|---|
| 341 | 328 | dfn=0; |
|---|
| 342 | 329 | afs=0; |
|---|
| 343 | 330 | } else { |
|---|
| .. | .. |
|---|
| 437 | 424 | fe->ops.i2c_gate_ctrl(fe, 0); |
|---|
| 438 | 425 | } |
|---|
| 439 | 426 | |
|---|
| 440 | | - /* calcluate the frequency offset (in *Hz* not kHz) */ |
|---|
| 427 | + /* calculate the frequency offset (in *Hz* not kHz) */ |
|---|
| 441 | 428 | freqoff = fe_params->frequency - freq; |
|---|
| 442 | 429 | freqoff = ((1<<16) * freqoff) / (SACLK/1000); |
|---|
| 443 | 430 | tda10086_write_byte(state, 0x3d, 0x80 | ((freqoff >> 8) & 0x7f)); |
|---|
| .. | .. |
|---|
| 777 | 764 | MODULE_AUTHOR("Andrew de Quincey"); |
|---|
| 778 | 765 | MODULE_LICENSE("GPL"); |
|---|
| 779 | 766 | |
|---|
| 780 | | -EXPORT_SYMBOL(tda10086_attach); |
|---|
| 767 | +EXPORT_SYMBOL_GPL(tda10086_attach); |
|---|