forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/regulator/88pm800-regulator.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Regulators driver for Marvell 88PM800
34 *
45 * Copyright (C) 2012 Marvell International Ltd.
56 * Joseph(Yossi) Hanin <yhanin@marvell.com>
67 * Yi Zhang <yizhang@marvell.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129 #include <linux/module.h>
1310 #include <linux/moduleparam.h>
....@@ -77,11 +74,6 @@
7774 int max_ua;
7875 };
7976
80
-struct pm800_regulators {
81
- struct pm80x_chip *chip;
82
- struct regmap *map;
83
-};
84
-
8577 /*
8678 * vreg - the buck regs string.
8779 * ereg - the string for the enable register.
....@@ -142,13 +134,13 @@
142134 }
143135
144136 /* Ranges are sorted in ascending order. */
145
-static const struct regulator_linear_range buck1_volt_range[] = {
137
+static const struct linear_range buck1_volt_range[] = {
146138 REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
147139 REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x54, 50000),
148140 };
149141
150142 /* BUCK 2~5 have same ranges. */
151
-static const struct regulator_linear_range buck2_5_volt_range[] = {
143
+static const struct linear_range buck2_5_volt_range[] = {
152144 REGULATOR_LINEAR_RANGE(600000, 0, 0x4f, 12500),
153145 REGULATOR_LINEAR_RANGE(1600000, 0x50, 0x72, 50000),
154146 };
....@@ -235,7 +227,6 @@
235227 {
236228 struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
237229 struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent);
238
- struct pm800_regulators *pm800_data;
239230 struct regulator_config config = { };
240231 struct regulator_init_data *init_data;
241232 int i, ret;
....@@ -252,18 +243,8 @@
252243 return -EINVAL;
253244 }
254245
255
- pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
256
- GFP_KERNEL);
257
- if (!pm800_data)
258
- return -ENOMEM;
259
-
260
- pm800_data->map = chip->subchip->regmap_power;
261
- pm800_data->chip = chip;
262
-
263
- platform_set_drvdata(pdev, pm800_data);
264
-
265246 config.dev = chip->dev;
266
- config.regmap = pm800_data->map;
247
+ config.regmap = chip->subchip->regmap_power;
267248 for (i = 0; i < PM800_ID_RG_MAX; i++) {
268249 struct regulator_dev *regulator;
269250