diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2009-10-28 12:30:15 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-12-17 05:27:25 -0500 |
commit | 176f45b9c9b7e451ac46becb92110f5e2de02d8c (patch) | |
tree | d4bfcaff1d2931091fe82b5a2d911544f9693fea /drivers/regulator/ab3100.c | |
parent | 495353a3f7fbb11e5100c9258365ff65a4834b37 (diff) |
Fix some AB3100 regulator issues
This patch will remove surplus register writes on shut down of
LDO D (this magic was not needed), remove an unnecessary (!) error
check and really unregister the regulators when the module is
unloaded.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/ab3100.c')
-rw-r--r-- | drivers/regulator/ab3100.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 5da127bbe1f2..b349db4504b7 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -241,24 +241,12 @@ static int ab3100_disable_regulator(struct regulator_dev *reg) | |||
241 | * LDO D is a special regulator. When it is disabled, the entire | 241 | * LDO D is a special regulator. When it is disabled, the entire |
242 | * system is shut down. So this is handled specially. | 242 | * system is shut down. So this is handled specially. |
243 | */ | 243 | */ |
244 | pr_info("Called ab3100_disable_regulator\n"); | ||
244 | if (abreg->regreg == AB3100_LDO_D) { | 245 | if (abreg->regreg == AB3100_LDO_D) { |
245 | int i; | ||
246 | |||
247 | dev_info(®->dev, "disabling LDO D - shut down system\n"); | 246 | dev_info(®->dev, "disabling LDO D - shut down system\n"); |
248 | /* | ||
249 | * Set regulators to default values, ignore any errors, | ||
250 | * we're going DOWN | ||
251 | */ | ||
252 | for (i = 0; i < ARRAY_SIZE(ab3100_reg_init_order); i++) { | ||
253 | (void) ab3100_set_register_interruptible(abreg->ab3100, | ||
254 | ab3100_reg_init_order[i], | ||
255 | abreg->plfdata->reg_initvals[i]); | ||
256 | } | ||
257 | |||
258 | /* Setting LDO D to 0x00 cuts the power to the SoC */ | 247 | /* Setting LDO D to 0x00 cuts the power to the SoC */ |
259 | return ab3100_set_register_interruptible(abreg->ab3100, | 248 | return ab3100_set_register_interruptible(abreg->ab3100, |
260 | AB3100_LDO_D, 0x00U); | 249 | AB3100_LDO_D, 0x00U); |
261 | |||
262 | } | 250 | } |
263 | 251 | ||
264 | /* | 252 | /* |
@@ -607,13 +595,6 @@ static int __init ab3100_regulators_probe(struct platform_device *pdev) | |||
607 | } | 595 | } |
608 | } | 596 | } |
609 | 597 | ||
610 | if (err) { | ||
611 | dev_err(&pdev->dev, | ||
612 | "LDO D regulator initialization failed with error %d\n", | ||
613 | err); | ||
614 | return err; | ||
615 | } | ||
616 | |||
617 | /* Register the regulators */ | 598 | /* Register the regulators */ |
618 | for (i = 0; i < AB3100_NUM_REGULATORS; i++) { | 599 | for (i = 0; i < AB3100_NUM_REGULATORS; i++) { |
619 | struct ab3100_regulator *reg = &ab3100_regulators[i]; | 600 | struct ab3100_regulator *reg = &ab3100_regulators[i]; |
@@ -688,7 +669,7 @@ static __init int ab3100_regulators_init(void) | |||
688 | 669 | ||
689 | static __exit void ab3100_regulators_exit(void) | 670 | static __exit void ab3100_regulators_exit(void) |
690 | { | 671 | { |
691 | platform_driver_register(&ab3100_regulators_driver); | 672 | platform_driver_unregister(&ab3100_regulators_driver); |
692 | } | 673 | } |
693 | 674 | ||
694 | subsys_initcall(ab3100_regulators_init); | 675 | subsys_initcall(ab3100_regulators_init); |