hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/media/dvb-frontends/dib0090.c
....@@ -1,23 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.
34 *
45 * Copyright (C) 2005-9 DiBcom (http://www.dibcom.fr/)
56 *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation; either version 2 of the
9
- * License, or (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful, but
12
- * 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
- *
187 * This code is more or less generated from another driver, please
198 * excuse some codingstyle oddities.
20
- *
219 */
2210
2311 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -1072,45 +1060,45 @@
10721060 void dib0090_pwm_gain_reset(struct dvb_frontend *fe)
10731061 {
10741062 struct dib0090_state *state = fe->tuner_priv;
1075
- u16 *bb_ramp = (u16 *)&bb_ramp_pwm_normal; /* default baseband config */
1076
- u16 *rf_ramp = NULL;
1063
+ const u16 *bb_ramp = bb_ramp_pwm_normal; /* default baseband config */
1064
+ const u16 *rf_ramp = NULL;
10771065 u8 en_pwm_rf_mux = 1;
10781066
10791067 /* reset the AGC */
10801068 if (state->config->use_pwm_agc) {
10811069 if (state->current_band == BAND_CBAND) {
10821070 if (state->identity.in_soc) {
1083
- bb_ramp = (u16 *)&bb_ramp_pwm_normal_socs;
1071
+ bb_ramp = bb_ramp_pwm_normal_socs;
10841072 if (state->identity.version == SOC_8090_P1G_11R1 || state->identity.version == SOC_8090_P1G_21R1)
1085
- rf_ramp = (u16 *)&rf_ramp_pwm_cband_8090;
1073
+ rf_ramp = rf_ramp_pwm_cband_8090;
10861074 else if (state->identity.version == SOC_7090_P1G_11R1 || state->identity.version == SOC_7090_P1G_21R1) {
10871075 if (state->config->is_dib7090e) {
10881076 if (state->rf_ramp == NULL)
1089
- rf_ramp = (u16 *)&rf_ramp_pwm_cband_7090e_sensitivity;
1077
+ rf_ramp = rf_ramp_pwm_cband_7090e_sensitivity;
10901078 else
1091
- rf_ramp = (u16 *)state->rf_ramp;
1079
+ rf_ramp = state->rf_ramp;
10921080 } else
1093
- rf_ramp = (u16 *)&rf_ramp_pwm_cband_7090p;
1081
+ rf_ramp = rf_ramp_pwm_cband_7090p;
10941082 }
10951083 } else
1096
- rf_ramp = (u16 *)&rf_ramp_pwm_cband;
1084
+ rf_ramp = rf_ramp_pwm_cband;
10971085 } else
10981086
10991087 if (state->current_band == BAND_VHF) {
11001088 if (state->identity.in_soc) {
1101
- bb_ramp = (u16 *)&bb_ramp_pwm_normal_socs;
1089
+ bb_ramp = bb_ramp_pwm_normal_socs;
11021090 /* rf_ramp = &rf_ramp_pwm_vhf_socs; */ /* TODO */
11031091 } else
1104
- rf_ramp = (u16 *)&rf_ramp_pwm_vhf;
1092
+ rf_ramp = rf_ramp_pwm_vhf;
11051093 } else if (state->current_band == BAND_UHF) {
11061094 if (state->identity.in_soc) {
1107
- bb_ramp = (u16 *)&bb_ramp_pwm_normal_socs;
1095
+ bb_ramp = bb_ramp_pwm_normal_socs;
11081096 if (state->identity.version == SOC_8090_P1G_11R1 || state->identity.version == SOC_8090_P1G_21R1)
1109
- rf_ramp = (u16 *)&rf_ramp_pwm_uhf_8090;
1097
+ rf_ramp = rf_ramp_pwm_uhf_8090;
11101098 else if (state->identity.version == SOC_7090_P1G_11R1 || state->identity.version == SOC_7090_P1G_21R1)
1111
- rf_ramp = (u16 *)&rf_ramp_pwm_uhf_7090;
1099
+ rf_ramp = rf_ramp_pwm_uhf_7090;
11121100 } else
1113
- rf_ramp = (u16 *)&rf_ramp_pwm_uhf;
1101
+ rf_ramp = rf_ramp_pwm_uhf;
11141102 }
11151103 if (rf_ramp)
11161104 dib0090_set_rframp_pwm(state, rf_ramp);
....@@ -1416,9 +1404,9 @@
14161404 }
14171405
14181406 if (cfg_sensitivity)
1419
- state->rf_ramp = (const u16 *)&rf_ramp_pwm_cband_7090e_sensitivity;
1407
+ state->rf_ramp = rf_ramp_pwm_cband_7090e_sensitivity;
14201408 else
1421
- state->rf_ramp = (const u16 *)&rf_ramp_pwm_cband_7090e_aci;
1409
+ state->rf_ramp = rf_ramp_pwm_cband_7090e_aci;
14221410 dib0090_pwm_gain_reset(fe);
14231411
14241412 return 0;
....@@ -1705,7 +1693,7 @@
17051693 if (state->identity.p1g)
17061694 state->dc = dc_p1g_table;
17071695
1708
- /* fall through */
1696
+ fallthrough;
17091697 case CT_TUNER_STEP_0:
17101698 dprintk("Start/continue DC calibration for %s path\n",
17111699 (state->dc->i == 1) ? "I" : "Q");
....@@ -1760,7 +1748,8 @@
17601748 }
17611749
17621750 dib0090_set_trim(state);
1763
- dprintk("BB Offset Cal, BBreg=%hd,Offset=%hd,Value Set=%hd\n", state->dc->addr, state->adc_diff, state->step);
1751
+ dprintk("BB Offset Cal, BBreg=%u,Offset=%d,Value Set=%d\n",
1752
+ state->dc->addr, state->adc_diff, state->step);
17641753
17651754 state->dc++;
17661755 if (state->dc->addr == 0) /* done */
....@@ -2459,7 +2448,7 @@
24592448 state->current_standard = state->fe->dtv_property_cache.delivery_system;
24602449
24612450 ret = 20;
2462
- state->calibrate = CAPTRIM_CAL; /* captrim serach now */
2451
+ state->calibrate = CAPTRIM_CAL; /* captrim search now */
24632452 }
24642453
24652454 else if (*tune_state == CT_TUNER_STEP_0) { /* Warning : because of captrim cal, if you change this step, change it also in _cal.c file because it is the step following captrim cal state machine */
....@@ -2643,7 +2632,7 @@
26432632 return NULL;
26442633 }
26452634
2646
-EXPORT_SYMBOL(dib0090_register);
2635
+EXPORT_SYMBOL_GPL(dib0090_register);
26472636
26482637 struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config)
26492638 {
....@@ -2669,7 +2658,7 @@
26692658 fe->tuner_priv = NULL;
26702659 return NULL;
26712660 }
2672
-EXPORT_SYMBOL(dib0090_fw_register);
2661
+EXPORT_SYMBOL_GPL(dib0090_fw_register);
26732662
26742663 MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@posteo.de>");
26752664 MODULE_AUTHOR("Olivier Grenie <olivier.grenie@parrot.com>");