projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59eadd2
)
regulator: da9121: Prevent current limit change when enabled
author
Adam Ward
<Adam.Ward.opensource@diasemi.com>
Mon, 29 Nov 2021 22:10:12 +0000
(22:10 +0000)
committer
Mark Brown
<broonie@kernel.org>
Tue, 30 Nov 2021 13:08:17 +0000
(13:08 +0000)
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>
drivers/regulator/da9121-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/da9121-regulator.c
b/drivers/regulator/da9121-regulator.c
index
a5a83b7
..
8614917
100644
(file)
--- 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;