hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/regulator/ab8500.c
....@@ -1,7 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) ST-Ericsson SA 2010
3
- *
4
- * License Terms: GNU General Public License v2
54 *
65 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
76 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
....@@ -44,7 +43,6 @@
4443 * struct ab8500_regulator_info - ab8500 regulator information
4544 * @dev: device pointer
4645 * @desc: regulator description
47
- * @regulator_dev: regulator device
4846 * @shared_mode: used when mode is shared between two regulators
4947 * @load_lp_uA: maximum load in idle (low power) mode
5048 * @update_bank: bank to control on/off
....@@ -61,11 +59,11 @@
6159 * @voltage_bank: bank to control regulator voltage
6260 * @voltage_reg: register to control regulator voltage
6361 * @voltage_mask: mask to control regulator voltage
62
+ * @expand_register:
6463 */
6564 struct ab8500_regulator_info {
6665 struct device *dev;
6766 struct regulator_desc desc;
68
- struct regulator_dev *regulator;
6967 struct ab8500_shared_mode *shared_mode;
7068 int load_lp_uA;
7169 u8 update_bank;
....@@ -82,12 +80,6 @@
8280 u8 voltage_bank;
8381 u8 voltage_reg;
8482 u8 voltage_mask;
85
- struct {
86
- u8 voltage_limit;
87
- u8 voltage_bank;
88
- u8 voltage_reg;
89
- u8 voltage_mask;
90
- } expand_register;
9183 };
9284
9385 /* voltage tables for the vauxn/vintcore supplies */
....@@ -142,17 +134,6 @@
142134 1350000,
143135 };
144136
145
-static const unsigned int ldo_sdio_voltages[] = {
146
- 1160000,
147
- 1050000,
148
- 1100000,
149
- 1500000,
150
- 1800000,
151
- 2200000,
152
- 2910000,
153
- 3050000,
154
-};
155
-
156137 static const unsigned int fixed_1200000_voltage[] = {
157138 1200000,
158139 };
....@@ -167,10 +148,6 @@
167148
168149 static const unsigned int fixed_2050000_voltage[] = {
169150 2050000,
170
-};
171
-
172
-static const unsigned int fixed_3300000_voltage[] = {
173
- 3300000,
174151 };
175152
176153 static const unsigned int ldo_vana_voltages[] = {
....@@ -193,13 +170,6 @@
193170 2500000,
194171 2600000,
195172 2600000, /* Duplicated in Vaudio and IsoUicc Control register. */
196
-};
197
-
198
-static const unsigned int ldo_vdmic_voltages[] = {
199
- 1800000,
200
- 1900000,
201
- 2000000,
202
- 2850000,
203173 };
204174
205175 static DEFINE_MUTEX(shared_mode_mutex);
....@@ -510,7 +480,7 @@
510480 return ret;
511481 }
512482
513
-static struct regulator_ops ab8500_regulator_volt_mode_ops = {
483
+static const struct regulator_ops ab8500_regulator_volt_mode_ops = {
514484 .enable = ab8500_regulator_enable,
515485 .disable = ab8500_regulator_disable,
516486 .is_enabled = ab8500_regulator_is_enabled,
....@@ -522,7 +492,7 @@
522492 .list_voltage = regulator_list_voltage_table,
523493 };
524494
525
-static struct regulator_ops ab8500_regulator_volt_ops = {
495
+static const struct regulator_ops ab8500_regulator_volt_ops = {
526496 .enable = ab8500_regulator_enable,
527497 .disable = ab8500_regulator_disable,
528498 .is_enabled = ab8500_regulator_is_enabled,
....@@ -531,7 +501,7 @@
531501 .list_voltage = regulator_list_voltage_table,
532502 };
533503
534
-static struct regulator_ops ab8500_regulator_mode_ops = {
504
+static const struct regulator_ops ab8500_regulator_mode_ops = {
535505 .enable = ab8500_regulator_enable,
536506 .disable = ab8500_regulator_disable,
537507 .is_enabled = ab8500_regulator_is_enabled,
....@@ -541,14 +511,14 @@
541511 .list_voltage = regulator_list_voltage_table,
542512 };
543513
544
-static struct regulator_ops ab8500_regulator_ops = {
514
+static const struct regulator_ops ab8500_regulator_ops = {
545515 .enable = ab8500_regulator_enable,
546516 .disable = ab8500_regulator_disable,
547517 .is_enabled = ab8500_regulator_is_enabled,
548518 .list_voltage = regulator_list_voltage_table,
549519 };
550520
551
-static struct regulator_ops ab8500_regulator_anamic_mode_ops = {
521
+static const struct regulator_ops ab8500_regulator_anamic_mode_ops = {
552522 .enable = ab8500_regulator_enable,
553523 .disable = ab8500_regulator_disable,
554524 .is_enabled = ab8500_regulator_is_enabled,
....@@ -1583,6 +1553,7 @@
15831553 struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
15841554 struct ab8500_regulator_info *info = NULL;
15851555 struct regulator_config config = { };
1556
+ struct regulator_dev *rdev;
15861557
15871558 /* assign per-regulator data */
15881559 info = &abx500_regulator.info[id];
....@@ -1604,12 +1575,11 @@
16041575 }
16051576
16061577 /* register regulator with framework */
1607
- info->regulator = devm_regulator_register(&pdev->dev, &info->desc,
1608
- &config);
1609
- if (IS_ERR(info->regulator)) {
1578
+ rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
1579
+ if (IS_ERR(rdev)) {
16101580 dev_err(&pdev->dev, "failed to register regulator %s\n",
16111581 info->desc.name);
1612
- return PTR_ERR(info->regulator);
1582
+ return PTR_ERR(rdev);
16131583 }
16141584
16151585 return 0;