hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/i2c/max2175.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Maxim Integrated MAX2175 RF to Bits tuner driver
34 *
....@@ -6,15 +7,6 @@
67 *
78 * Copyright (C) 2016 Maxim Integrated Products
89 * Copyright (C) 2017 Renesas Electronics Corporation
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2
12
- * as published by the Free Software Foundation.
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.
1810 */
1911
2012 #include <linux/clk.h>
....@@ -599,8 +591,8 @@
599591 lo_freq *= lo_mult;
600592
601593 int_desired = lo_freq / ctx->xtal_freq;
602
- frac_desired = div_u64((u64)(lo_freq % ctx->xtal_freq) << 20,
603
- ctx->xtal_freq);
594
+ frac_desired = div64_ul((u64)(lo_freq % ctx->xtal_freq) << 20,
595
+ ctx->xtal_freq);
604596
605597 /* Check CSM is not busy */
606598 ret = max2175_poll_csm_ready(ctx);
....@@ -1165,7 +1157,7 @@
11651157 if (vt->index > 0)
11661158 return -EINVAL;
11671159
1168
- strlcpy(vt->name, "RF", sizeof(vt->name));
1160
+ strscpy(vt->name, "RF", sizeof(vt->name));
11691161 vt->type = V4L2_TUNER_RF;
11701162 vt->capability = V4L2_TUNER_CAP_1HZ | V4L2_TUNER_CAP_FREQ_BANDS;
11711163 vt->rangelow = ctx->bands_rf->rangelow;
....@@ -1202,7 +1194,7 @@
12021194
12031195 /*
12041196 * I2S output enable/disable configuration. This is a private control.
1205
- * Refer to Documentation/media/v4l-drivers/max2175.rst for more details.
1197
+ * Refer to Documentation/userspace-api/media/drivers/max2175.rst for more details.
12061198 */
12071199 static const struct v4l2_ctrl_config max2175_i2s_en = {
12081200 .ops = &max2175_ctrl_ops,
....@@ -1218,7 +1210,7 @@
12181210
12191211 /*
12201212 * HSLS value control LO freq adjacent location configuration.
1221
- * Refer to Documentation/media/v4l-drivers/max2175.rst for more details.
1213
+ * Refer to Documentation/userspace-api/media/drivers/max2175.rst for more details.
12221214 */
12231215 static const struct v4l2_ctrl_config max2175_hsls = {
12241216 .ops = &max2175_ctrl_ops,
....@@ -1234,7 +1226,7 @@
12341226 /*
12351227 * Rx modes below are a set of preset configurations that decides the tuner's
12361228 * sck and sample rate of transmission. They are separate for EU & NA regions.
1237
- * Refer to Documentation/media/v4l-drivers/max2175.rst for more details.
1229
+ * Refer to Documentation/userspace-api/media/drivers/max2175.rst for more details.
12381230 */
12391231 static const char * const max2175_ctrl_eu_rx_modes[] = {
12401232 [MAX2175_EU_FM_1_2] = "EU FM 1.2",
....@@ -1279,8 +1271,7 @@
12791271 return 0;
12801272 }
12811273
1282
-static int max2175_probe(struct i2c_client *client,
1283
- const struct i2c_device_id *id)
1274
+static int max2175_probe(struct i2c_client *client)
12841275 {
12851276 bool master = true, am_hiz = false;
12861277 u32 refout_load, refout_bits = 0; /* REFOUT disabled */
....@@ -1441,7 +1432,7 @@
14411432 .name = DRIVER_NAME,
14421433 .of_match_table = max2175_of_ids,
14431434 },
1444
- .probe = max2175_probe,
1435
+ .probe_new = max2175_probe,
14451436 .remove = max2175_remove,
14461437 .id_table = max2175_id,
14471438 };