summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown2018-12-11 02:17:23 +0100
committerMark Brown2018-12-11 02:17:23 +0100
commitd407c81adae57041ba82577e604e351f36b8afce (patch)
treedcacd9522369cde44919da0bafd843c3cc9e7bc2 /drivers/regulator
parentLinux 4.20-rc6 (diff)
parentregulator: core: enable power when setting up constraints (diff)
downloadkernel-qcow2-linux-d407c81adae57041ba82577e604e351f36b8afce.tar.gz
kernel-qcow2-linux-d407c81adae57041ba82577e604e351f36b8afce.tar.xz
kernel-qcow2-linux-d407c81adae57041ba82577e604e351f36b8afce.zip
Merge branch 'regulator-4.20' into regulator-linus
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/bd718x7-regulator.c1
-rw-r--r--drivers/regulator/core.c22
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index 3a47e0372e77..7ba14dae5848 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/mfd/rohm-bd718x7.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 2c66b528aede..6e146102fd93 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1158,17 +1158,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}
- /* If the constraints say the regulator should be on at this point
- * and we have control then make sure it is enabled.
- */
- if (rdev->constraints->always_on || rdev->constraints->boot_on) {
- ret = _regulator_do_enable(rdev);
- if (ret < 0 && ret != -EINVAL) {
- rdev_err(rdev, "failed to enable\n");
- return ret;
- }
- }
-
if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable)
&& ops->set_ramp_delay) {
ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay);
@@ -1214,6 +1203,17 @@ static int set_machine_constraints(struct regulator_dev *rdev,
}
}
+ /* If the constraints say the regulator should be on at this point
+ * and we have control then make sure it is enabled.
+ */
+ if (rdev->constraints->always_on || rdev->constraints->boot_on) {
+ ret = _regulator_do_enable(rdev);
+ if (ret < 0 && ret != -EINVAL) {
+ rdev_err(rdev, "failed to enable\n");
+ return ret;
+ }
+ }
+
print_constraints(rdev);
return 0;
}