mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
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>
This commit is contained in:
parent
495353a3f7
commit
176f45b9c9
1 changed files with 2 additions and 21 deletions
|
@ -241,24 +241,12 @@ static int ab3100_disable_regulator(struct regulator_dev *reg)
|
|||
* LDO D is a special regulator. When it is disabled, the entire
|
||||
* system is shut down. So this is handled specially.
|
||||
*/
|
||||
pr_info("Called ab3100_disable_regulator\n");
|
||||
if (abreg->regreg == AB3100_LDO_D) {
|
||||
int i;
|
||||
|
||||
dev_info(®->dev, "disabling LDO D - shut down system\n");
|
||||
/*
|
||||
* Set regulators to default values, ignore any errors,
|
||||
* we're going DOWN
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(ab3100_reg_init_order); i++) {
|
||||
(void) ab3100_set_register_interruptible(abreg->ab3100,
|
||||
ab3100_reg_init_order[i],
|
||||
abreg->plfdata->reg_initvals[i]);
|
||||
}
|
||||
|
||||
/* Setting LDO D to 0x00 cuts the power to the SoC */
|
||||
return ab3100_set_register_interruptible(abreg->ab3100,
|
||||
AB3100_LDO_D, 0x00U);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -607,13 +595,6 @@ static int __init ab3100_regulators_probe(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
dev_err(&pdev->dev,
|
||||
"LDO D regulator initialization failed with error %d\n",
|
||||
err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Register the regulators */
|
||||
for (i = 0; i < AB3100_NUM_REGULATORS; i++) {
|
||||
struct ab3100_regulator *reg = &ab3100_regulators[i];
|
||||
|
@ -688,7 +669,7 @@ static __init int ab3100_regulators_init(void)
|
|||
|
||||
static __exit void ab3100_regulators_exit(void)
|
||||
{
|
||||
platform_driver_register(&ab3100_regulators_driver);
|
||||
platform_driver_unregister(&ab3100_regulators_driver);
|
||||
}
|
||||
|
||||
subsys_initcall(ab3100_regulators_init);
|
||||
|
|
Loading…
Reference in a new issue