[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52ee682476004a1736c1e0293358987319c1c415.1638223185.git.Adam.Ward.opensource@diasemi.com>
Date: Mon, 29 Nov 2021 22:10:12 +0000
From: Adam Ward <Adam.Ward.opensource@...semi.com>
To: Mark Brown <broonie@...nel.org>, Rob Herring <robh+dt@...nel.org>
CC: Liam Girdwood <lgirdwood@...il.com>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
Support Opensource <support.opensource@...semi.com>
Subject: [PATCH V4 3/4] 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@...semi.com>
---
drivers/regulator/da9121-regulator.c | 5 +++++
1 file changed, 5 insertions(+)
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;
--
2.25.1
Powered by blists - more mailing lists