hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/dvb-frontends/tda18271c2dd.c
....@@ -1,26 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * tda18271c2dd: Driver for the TDA18271C2 tuner
34 *
45 * Copyright (C) 2010 Digital Devices GmbH
5
- *
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * version 2 only, as published by the Free Software Foundation.
10
- *
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * To obtain the license, point your browser to
18
- * http://www.gnu.org/copyleft/gpl.html
196 */
207
218 #include <linux/kernel.h>
229 #include <linux/module.h>
23
-#include <linux/moduleparam.h>
2410 #include <linux/init.h>
2511 #include <linux/delay.h>
2612 #include <linux/firmware.h>
....@@ -106,7 +92,7 @@
10692 s32 m_RF_B2[7];
10793 u32 m_RF3[7];
10894
109
- u8 m_TMValue_RFCal; /* Calibration temperatur */
95
+ u8 m_TMValue_RFCal; /* Calibration temperature */
11096
11197 bool m_bFMInput; /* true to use Pin 8 for FM Radio */
11298
....@@ -212,58 +198,55 @@
212198 state->m_bFMInput = (ulFMInput == 2);
213199 }
214200
215
-static bool SearchMap1(struct SMap Map[],
216
- u32 Frequency, u8 *pParam)
201
+static bool SearchMap1(const struct SMap map[], u32 frequency, u8 *param)
217202 {
218203 int i = 0;
219204
220
- while ((Map[i].m_Frequency != 0) && (Frequency > Map[i].m_Frequency))
205
+ while ((map[i].m_Frequency != 0) && (frequency > map[i].m_Frequency))
221206 i += 1;
222
- if (Map[i].m_Frequency == 0)
207
+ if (map[i].m_Frequency == 0)
223208 return false;
224
- *pParam = Map[i].m_Param;
209
+ *param = map[i].m_Param;
225210 return true;
226211 }
227212
228
-static bool SearchMap2(struct SMapI Map[],
229
- u32 Frequency, s32 *pParam)
213
+static bool SearchMap2(const struct SMapI map[], u32 frequency, s32 *param)
230214 {
231215 int i = 0;
232216
233
- while ((Map[i].m_Frequency != 0) &&
234
- (Frequency > Map[i].m_Frequency))
217
+ while ((map[i].m_Frequency != 0) &&
218
+ (frequency > map[i].m_Frequency))
235219 i += 1;
236
- if (Map[i].m_Frequency == 0)
220
+ if (map[i].m_Frequency == 0)
237221 return false;
238
- *pParam = Map[i].m_Param;
222
+ *param = map[i].m_Param;
239223 return true;
240224 }
241225
242
-static bool SearchMap3(struct SMap2 Map[], u32 Frequency,
243
- u8 *pParam1, u8 *pParam2)
226
+static bool SearchMap3(const struct SMap2 map[], u32 frequency, u8 *param1,
227
+ u8 *param2)
244228 {
245229 int i = 0;
246230
247
- while ((Map[i].m_Frequency != 0) &&
248
- (Frequency > Map[i].m_Frequency))
231
+ while ((map[i].m_Frequency != 0) &&
232
+ (frequency > map[i].m_Frequency))
249233 i += 1;
250
- if (Map[i].m_Frequency == 0)
234
+ if (map[i].m_Frequency == 0)
251235 return false;
252
- *pParam1 = Map[i].m_Param1;
253
- *pParam2 = Map[i].m_Param2;
236
+ *param1 = map[i].m_Param1;
237
+ *param2 = map[i].m_Param2;
254238 return true;
255239 }
256240
257
-static bool SearchMap4(struct SRFBandMap Map[],
258
- u32 Frequency, u8 *pRFBand)
241
+static bool SearchMap4(const struct SRFBandMap map[], u32 frequency, u8 *rfband)
259242 {
260243 int i = 0;
261244
262
- while (i < 7 && (Frequency > Map[i].m_RF_max))
245
+ while (i < 7 && (frequency > map[i].m_RF_max))
263246 i += 1;
264247 if (i == 7)
265248 return false;
266
- *pRFBand = i;
249
+ *rfband = i;
267250 return true;
268251 }
269252
....@@ -401,7 +384,7 @@
401384 break;
402385
403386 /* Switching off LT (as datasheet says) causes calibration on C1 to fail */
404
- /* (Readout of Cprog is allways 255) */
387
+ /* (Readout of Cprog is always 255) */
405388 if (state->m_Regs[ID] != 0x83) /* C1: ID == 83, C2: ID == 84 */
406389 state->m_Regs[EP3] |= 0x40; /* SM_LT = 1 */
407390
....@@ -645,7 +628,7 @@
645628 if (status < 0)
646629 break;
647630 CID_Gain = Regs[EB10] & 0x3F;
648
- state->m_Regs[ID] = Regs[ID]; /* Chip version, (needed for C1 workarround in CalibrateRF) */
631
+ state->m_Regs[ID] = Regs[ID]; /* Chip version, (needed for C1 workaround in CalibrateRF) */
649632
650633 *pRF_Out = RF_in;
651634