11 #include <linux/kernel.h>
22 #include <linux/module.h>
44 static int db8500_regulator_disable(
struct regulator_dev *rdev)
64 static int db8500_regulator_is_enabled(
struct regulator_dev *rdev)
79 .enable = db8500_regulator_enable,
80 .disable = db8500_regulator_disable,
81 .is_enabled = db8500_regulator_is_enabled,
90 static int enable_epod(
u16 epod_id,
bool ramret)
95 if (!epod_on[epod_id]) {
100 epod_ramret[epod_id] =
true;
105 epod_on[epod_id] =
true;
111 static int disable_epod(
u16 epod_id,
bool ramret)
116 if (!epod_on[epod_id]) {
121 epod_ramret[epod_id] =
false;
123 if (epod_ramret[epod_id]) {
132 epod_on[epod_id] =
false;
141 static int db8500_regulator_switch_enable(
struct regulator_dev *rdev)
155 "regulator-switch-%s-enable: prcmu call failed\n",
165 static int db8500_regulator_switch_disable(
struct regulator_dev *rdev)
179 "regulator_switch-%s-disable: prcmu call failed\n",
189 static int db8500_regulator_switch_is_enabled(
struct regulator_dev *rdev)
197 "regulator-switch-%s-is_enabled (is_enabled): %i\n",
204 .enable = db8500_regulator_switch_enable,
205 .disable = db8500_regulator_switch_disable,
206 .is_enabled = db8500_regulator_switch_is_enabled,
216 .name =
"db8500-vape",
218 .ops = &db8500_regulator_ops,
225 .name =
"db8500-varm",
227 .ops = &db8500_regulator_ops,
234 .name =
"db8500-vmodem",
236 .ops = &db8500_regulator_ops,
243 .name =
"db8500-vpll",
245 .ops = &db8500_regulator_ops,
252 .name =
"db8500-vsmps1",
254 .ops = &db8500_regulator_ops,
261 .name =
"db8500-vsmps2",
263 .ops = &db8500_regulator_ops,
267 .exclude_from_power_state =
true,
271 .name =
"db8500-vsmps3",
273 .ops = &db8500_regulator_ops,
280 .name =
"db8500-vrf1",
282 .ops = &db8500_regulator_ops,
289 .name =
"db8500-sva-mmdsp",
291 .ops = &db8500_regulator_switch_ops,
299 .name =
"db8500-sva-mmdsp-ret",
301 .ops = &db8500_regulator_switch_ops,
310 .name =
"db8500-sva-pipe",
312 .ops = &db8500_regulator_switch_ops,
320 .name =
"db8500-sia-mmdsp",
322 .ops = &db8500_regulator_switch_ops,
330 .name =
"db8500-sia-mmdsp-ret",
332 .ops = &db8500_regulator_switch_ops,
341 .name =
"db8500-sia-pipe",
343 .ops = &db8500_regulator_switch_ops,
351 .name =
"db8500-sga",
353 .ops = &db8500_regulator_switch_ops,
361 .name =
"db8500-b2r2-mcde",
363 .ops = &db8500_regulator_switch_ops,
371 .name =
"db8500-esram12",
373 .ops = &db8500_regulator_switch_ops,
382 .name =
"db8500-esram12-ret",
384 .ops = &db8500_regulator_switch_ops,
393 .name =
"db8500-esram34",
395 .ops = &db8500_regulator_switch_ops,
404 .name =
"db8500-esram34-ret",
406 .ops = &db8500_regulator_switch_ops,
420 struct dbx500_regulator_info *
info;
425 info = &dbx500_regulator_info[
id];
435 if (IS_ERR(info->
rdev)) {
436 err = PTR_ERR(info->
rdev);
437 dev_err(&pdev->
dev,
"failed to register %s: err %i\n",
438 info->
desc.name, err);
442 info = &dbx500_regulator_info[
id];
449 "regulator-%s-probed\n", info->
desc.name);
483 for (i = 0; i <
ARRAY_SIZE(dbx500_regulator_info); i++) {
484 err = db8500_regulator_register(
485 pdev, db8500_regulator_matches[i].init_data,
486 i, db8500_regulator_matches[i].
of_node);
497 dev_get_platdata(&pdev->
dev);
504 db8500_regulator_matches,
508 "Error parsing regulator init data: %d\n", err);
512 err = db8500_regulator_of_probe(pdev, np);
516 for (i = 0; i <
ARRAY_SIZE(dbx500_regulator_info); i++) {
517 err = db8500_regulator_register(pdev,
518 &db8500_init_data[i],
525 err = ux500_regulator_debug_init(pdev,
526 dbx500_regulator_info,
535 ux500_regulator_debug_exit();
537 for (i = 0; i <
ARRAY_SIZE(dbx500_regulator_info); i++) {
538 struct dbx500_regulator_info *
info;
539 info = &dbx500_regulator_info[
i];
542 "regulator-%s-remove\n", info->
desc.name);
552 .name =
"db8500-prcmu-regulators",
555 .probe = db8500_regulator_probe,
556 .remove =
__exit_p(db8500_regulator_remove),
559 static int __init db8500_regulator_init(
void)
564 static void __exit db8500_regulator_exit(
void)