Skip to content

Commit 24f0853

Browse files
Adam Wardbroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/52ee682476004a1736c1e0293358987319c1c415.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <[email protected]>
1 parent 59eadd2 commit 24f0853

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/regulator/da9121-regulator.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ static int da9121_set_current_limit(struct regulator_dev *rdev,
253253
goto error;
254254
}
255255

256+
if (rdev->desc->ops->is_enabled(rdev)) {
257+
ret = -EBUSY;
258+
goto error;
259+
}
260+
256261
ret = da9121_ceiling_selector(rdev, min_ua, max_ua, &sel);
257262
if (ret < 0)
258263
goto error;

0 commit comments

Comments
 (0)