Skip to content

Commit

Permalink
regulator: da9121: Prevent current limit change when enabled
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/1959376

[ Upstream commit 24f0853 ]

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]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Paolo Pisati <[email protected]>
  • Loading branch information
Adam Ward authored and tobhe committed Dec 15, 2022
1 parent 05e2640 commit 9ac606e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/regulator/da9121-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,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;
Expand Down

0 comments on commit 9ac606e

Please sign in to comment.