| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | TDA10021 - Single Chip Cable Channel Receiver driver module |
|---|
| 3 | 4 | used on the Siemens DVB-C cards |
|---|
| .. | .. |
|---|
| 6 | 7 | Copyright (C) 2004 Markus Schulz <msc@antzsystem.de> |
|---|
| 7 | 8 | Support for TDA10021 |
|---|
| 8 | 9 | |
|---|
| 9 | | - This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - (at your option) any later version. |
|---|
| 13 | | - |
|---|
| 14 | | - This program is distributed in the hope that it will be useful, |
|---|
| 15 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - GNU General Public License for more details. |
|---|
| 18 | | - |
|---|
| 19 | | - You should have received a copy of the GNU General Public License |
|---|
| 20 | | - along with this program; if not, write to the Free Software |
|---|
| 21 | | - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 22 | 10 | */ |
|---|
| 23 | 11 | |
|---|
| 24 | 12 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 149 | 137 | { |
|---|
| 150 | 138 | s32 BDR; |
|---|
| 151 | 139 | s32 BDRI; |
|---|
| 152 | | - s16 SFIL=0; |
|---|
| 140 | + s16 SFIL = 0; |
|---|
| 153 | 141 | u16 NDEC = 0; |
|---|
| 154 | 142 | u32 tmp, ratio; |
|---|
| 155 | 143 | |
|---|
| 156 | | - if (symbolrate > XIN/2) |
|---|
| 157 | | - symbolrate = XIN/2; |
|---|
| 158 | | - if (symbolrate < 500000) |
|---|
| 144 | + if (symbolrate > XIN / 2) |
|---|
| 145 | + symbolrate = XIN / 2; |
|---|
| 146 | + else if (symbolrate < 500000) |
|---|
| 159 | 147 | symbolrate = 500000; |
|---|
| 160 | 148 | |
|---|
| 161 | | - if (symbolrate < XIN/16) NDEC = 1; |
|---|
| 162 | | - if (symbolrate < XIN/32) NDEC = 2; |
|---|
| 163 | | - if (symbolrate < XIN/64) NDEC = 3; |
|---|
| 149 | + if (symbolrate < XIN / 16) |
|---|
| 150 | + NDEC = 1; |
|---|
| 151 | + if (symbolrate < XIN / 32) |
|---|
| 152 | + NDEC = 2; |
|---|
| 153 | + if (symbolrate < XIN / 64) |
|---|
| 154 | + NDEC = 3; |
|---|
| 164 | 155 | |
|---|
| 165 | | - if (symbolrate < (u32)(XIN/12.3)) SFIL = 1; |
|---|
| 166 | | - if (symbolrate < (u32)(XIN/16)) SFIL = 0; |
|---|
| 167 | | - if (symbolrate < (u32)(XIN/24.6)) SFIL = 1; |
|---|
| 168 | | - if (symbolrate < (u32)(XIN/32)) SFIL = 0; |
|---|
| 169 | | - if (symbolrate < (u32)(XIN/49.2)) SFIL = 1; |
|---|
| 170 | | - if (symbolrate < (u32)(XIN/64)) SFIL = 0; |
|---|
| 171 | | - if (symbolrate < (u32)(XIN/98.4)) SFIL = 1; |
|---|
| 156 | + if (symbolrate < XIN * 10 / 123) |
|---|
| 157 | + SFIL = 1; |
|---|
| 158 | + if (symbolrate < XIN * 10 / 160) |
|---|
| 159 | + SFIL = 0; |
|---|
| 160 | + if (symbolrate < XIN * 10 / 246) |
|---|
| 161 | + SFIL = 1; |
|---|
| 162 | + if (symbolrate < XIN * 10 / 320) |
|---|
| 163 | + SFIL = 0; |
|---|
| 164 | + if (symbolrate < XIN * 10 / 492) |
|---|
| 165 | + SFIL = 1; |
|---|
| 166 | + if (symbolrate < XIN * 10 / 640) |
|---|
| 167 | + SFIL = 0; |
|---|
| 168 | + if (symbolrate < XIN * 10 / 984) |
|---|
| 169 | + SFIL = 1; |
|---|
| 172 | 170 | |
|---|
| 173 | 171 | symbolrate <<= NDEC; |
|---|
| 174 | 172 | ratio = (symbolrate << 4) / FIN; |
|---|
| .. | .. |
|---|
| 525 | 523 | MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Markus Schulz"); |
|---|
| 526 | 524 | MODULE_LICENSE("GPL"); |
|---|
| 527 | 525 | |
|---|
| 528 | | -EXPORT_SYMBOL(tda10021_attach); |
|---|
| 526 | +EXPORT_SYMBOL_GPL(tda10021_attach); |
|---|