summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAdam Ward <Adam.Ward.opensource@diasemi.com>2021-11-29 22:10:12 +0000
committerMark Brown <broonie@kernel.org>2021-11-30 13:08:17 +0000
commit24f0853228f3b98f1ef08d5824376c69bb8124d2 (patch)
treeef14e0ff751382a85ee6d178d03cfdb49f441273 /drivers/regulator
parent59eadd2af3f717f2ff70dbb6c153757dc1650651 (diff)
downloadlwn-24f0853228f3b98f1ef08d5824376c69bb8124d2.tar.gz
lwn-24f0853228f3b98f1ef08d5824376c69bb8124d2.zip
regulator: da9121: Prevent current limit change when enabled
Prevent changing current limit when enabled as a precaution against possibile instability due to tight integration with switching cycle Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/52ee682476004a1736c1e0293358987319c1c415.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/da9121-regulator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/da9121-regulator.c b/drivers/regulator/da9121-regulator.c
index a5a83b772a85..86149170bf6c 100644
--- a/drivers/regulator/da9121-regulator.c
+++ b/drivers/regulator/da9121-regulator.c
@@ -253,6 +253,11 @@ static int da9121_set_current_limit(struct regulator_dev *rdev,
goto error;
}
+ if (rdev->desc->ops->is_enabled(rdev)) {
+ ret = -EBUSY;
+ goto error;
+ }
+
ret = da9121_ceiling_selector(rdev, min_ua, max_ua, &sel);
if (ret < 0)
goto error;