diff options
author | Mark Brown <broonie@kernel.org> | 2015-07-24 18:29:31 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-24 18:29:31 +0100 |
commit | 41dae91a7206d9a09047f3d376282bba4d9545b5 (patch) | |
tree | fe12449256757eea6c14d7d041cc494b712e83ba /drivers/regulator | |
parent | 5d506a5ad4155e813d254d2f02ce17b58045423c (diff) | |
parent | 3a003baeec246f604ed1d2e0087560d7f15edcc6 (diff) | |
download | linux-41dae91a7206d9a09047f3d376282bba4d9545b5.tar.bz2 |
Merge branch 'topic/ocp' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-qcom-spmi
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 9 | ||||
-rw-r--r-- | drivers/regulator/of_regulator.c | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c9f72019bd68..520413e2bca0 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1081,6 +1081,15 @@ static int set_machine_constraints(struct regulator_dev *rdev, } } + if (rdev->constraints->over_current_protection + && ops->set_over_current_protection) { + ret = ops->set_over_current_protection(rdev); + if (ret < 0) { + rdev_err(rdev, "failed to set over current protection\n"); + goto out; + } + } + print_constraints(rdev); return 0; out: 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: |