forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/regulator/palmas-regulator.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for Regulator part of Palmas PMIC Chips
34 *
....@@ -5,12 +6,6 @@
56 *
67 * Author: Graeme Gregory <gg@slimlogic.co.uk>
78 * Author: Ian Lartey <ian@slimlogic.co.uk>
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
13
- *
149 */
1510
1611 #include <linux/kernel.h>
....@@ -27,14 +22,14 @@
2722 #include <linux/of_platform.h>
2823 #include <linux/regulator/of_regulator.h>
2924
30
-static const struct regulator_linear_range smps_low_ranges[] = {
25
+static const struct linear_range smps_low_ranges[] = {
3126 REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0),
3227 REGULATOR_LINEAR_RANGE(500000, 0x1, 0x6, 0),
3328 REGULATOR_LINEAR_RANGE(510000, 0x7, 0x79, 10000),
3429 REGULATOR_LINEAR_RANGE(1650000, 0x7A, 0x7f, 0),
3530 };
3631
37
-static const struct regulator_linear_range smps_high_ranges[] = {
32
+static const struct linear_range smps_high_ranges[] = {
3833 REGULATOR_LINEAR_RANGE(0, 0x0, 0x0, 0),
3934 REGULATOR_LINEAR_RANGE(1000000, 0x1, 0x6, 0),
4035 REGULATOR_LINEAR_RANGE(1020000, 0x7, 0x79, 20000),
....@@ -382,7 +377,7 @@
382377 EXTERNAL_REQUESTOR_TPS65917(LDO5, 2, 4),
383378 };
384379
385
-static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500};
380
+static const unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500};
386381
387382 #define SMPS_CTRL_MODE_OFF 0x00
388383 #define SMPS_CTRL_MODE_ON 0x01
....@@ -991,9 +986,6 @@
991986 return PTR_ERR(rdev);
992987 }
993988
994
- /* Save regulator for cleanup */
995
- pmic->rdev[id] = rdev;
996
-
997989 /* Initialise sleep/init values from platform data */
998990 if (pdata) {
999991 reg_init = pdata->reg_init[id];
....@@ -1100,9 +1092,6 @@
11001092 pdev_name);
11011093 return PTR_ERR(rdev);
11021094 }
1103
-
1104
- /* Save regulator for cleanup */
1105
- pmic->rdev[id] = rdev;
11061095
11071096 /* Initialise sleep/init values from platform data */
11081097 if (pdata) {
....@@ -1288,9 +1277,6 @@
12881277 pdev_name);
12891278 return PTR_ERR(rdev);
12901279 }
1291
-
1292
- /* Save regulator for cleanup */
1293
- pmic->rdev[id] = rdev;
12941280 }
12951281
12961282 return 0;
....@@ -1395,9 +1381,6 @@
13951381 pdev_name);
13961382 return PTR_ERR(rdev);
13971383 }
1398
-
1399
- /* Save regulator for cleanup */
1400
- pmic->rdev[id] = rdev;
14011384 }
14021385
14031386 return 0;