Commit 24f08532 authored by Adam Ward's avatar Adam Ward Committed by Mark Brown

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: default avatarAdam Ward <Adam.Ward.opensource@diasemi.com>
Link: https://lore.kernel.org/r/52ee682476004a1736c1e0293358987319c1c415.1638223185.git.Adam.Ward.opensource@diasemi.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 59eadd2a
...@@ -253,6 +253,11 @@ static int da9121_set_current_limit(struct regulator_dev *rdev, ...@@ -253,6 +253,11 @@ static int da9121_set_current_limit(struct regulator_dev *rdev,
goto error; goto error;
} }
if (rdev->desc->ops->is_enabled(rdev)) {
ret = -EBUSY;
goto error;
}
ret = da9121_ceiling_selector(rdev, min_ua, max_ua, &sel); ret = da9121_ceiling_selector(rdev, min_ua, max_ua, &sel);
if (ret < 0) if (ret < 0)
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment