forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-09 244b2c5ca8b14627e4a17755e5922221e121c771
kernel/drivers/regulator/max14577-regulator.c
....@@ -155,59 +155,7 @@
155155 [MAX77836_LDO2] = MAX77836_LDO_REG(2),
156156 };
157157
158
-#ifdef CONFIG_OF
159
-static struct of_regulator_match max14577_regulator_matches[] = {
160
- { .name = "SAFEOUT", },
161
- { .name = "CHARGER", },
162
-};
163
-
164
-static struct of_regulator_match max77836_regulator_matches[] = {
165
- { .name = "SAFEOUT", },
166
- { .name = "CHARGER", },
167
- { .name = "LDO1", },
168
- { .name = "LDO2", },
169
-};
170
-
171
-static inline struct regulator_init_data *match_init_data(int index,
172
- enum maxim_device_type dev_type)
173
-{
174
- switch (dev_type) {
175
- case MAXIM_DEVICE_TYPE_MAX77836:
176
- return max77836_regulator_matches[index].init_data;
177
-
178
- case MAXIM_DEVICE_TYPE_MAX14577:
179
- default:
180
- return max14577_regulator_matches[index].init_data;
181
- }
182
-}
183
-
184
-static inline struct device_node *match_of_node(int index,
185
- enum maxim_device_type dev_type)
186
-{
187
- switch (dev_type) {
188
- case MAXIM_DEVICE_TYPE_MAX77836:
189
- return max77836_regulator_matches[index].of_node;
190
-
191
- case MAXIM_DEVICE_TYPE_MAX14577:
192
- default:
193
- return max14577_regulator_matches[index].of_node;
194
- }
195
-}
196
-#else /* CONFIG_OF */
197
-static inline struct regulator_init_data *match_init_data(int index,
198
- enum maxim_device_type dev_type)
199
-{
200
- return NULL;
201
-}
202
-
203
-static inline struct device_node *match_of_node(int index,
204
- enum maxim_device_type dev_type)
205
-{
206
- return NULL;
207
-}
208
-#endif /* CONFIG_OF */
209
-
210
-/**
158
+/*
211159 * Registers for regulators of max77836 use different I2C slave addresses so
212160 * different regmaps must be used for them.
213161 *
....@@ -265,9 +213,6 @@
265213 if (pdata && pdata->regulators) {
266214 config.init_data = pdata->regulators[i].initdata;
267215 config.of_node = pdata->regulators[i].of_node;
268
- } else {
269
- config.init_data = match_init_data(i, dev_type);
270
- config.of_node = match_of_node(i, dev_type);
271216 }
272217 config.regmap = max14577_get_regmap(max14577,
273218 supported_regulators[i].id);
....@@ -324,4 +269,3 @@
324269 MODULE_AUTHOR("Krzysztof Kozlowski <krzk@kernel.org>");
325270 MODULE_DESCRIPTION("Maxim 14577/77836 regulator driver");
326271 MODULE_LICENSE("GPL");
327
-MODULE_ALIAS("platform:max14577-regulator");