summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/of_regulator.c
diff options
context:
space:
mode:
authorStephen Boyd2015-07-17 23:41:54 +0200
committerMark Brown2015-07-24 19:28:46 +0200
commit3a003baeec246f604ed1d2e0087560d7f15edcc6 (patch)
tree6b9e16f35e605a1b23386be578df569b599e978b /drivers/regulator/of_regulator.c
parentLinux 4.2-rc2 (diff)
downloadkernel-qcow2-linux-3a003baeec246f604ed1d2e0087560d7f15edcc6.tar.gz
kernel-qcow2-linux-3a003baeec246f604ed1d2e0087560d7f15edcc6.tar.xz
kernel-qcow2-linux-3a003baeec246f604ed1d2e0087560d7f15edcc6.zip
regulator: Add over current protection (OCP) support
Some regulators can automatically shut down when they detect an over current event. Add an op (set_over_current_protection) and a DT property + constraint to support this capability. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/of_regulator.c')
-rw-r--r--drivers/regulator/of_regulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index b1c485b24ab2..250700c853bf 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -107,6 +107,9 @@ static void of_get_regulation_constraints(struct device_node *np,
if (!of_property_read_u32(np, "regulator-system-load", &pval))
constraints->system_load = pval;
+ constraints->over_current_protection = of_property_read_bool(np,
+ "regulator-over-current-protection");
+
for (i = 0; i < ARRAY_SIZE(regulator_states); i++) {
switch (i) {
case PM_SUSPEND_MEM: