[PATCH RFC v4 12/13] regulator: da9063: let the core handle the monitors

From: Benjamin Bara
Date: Tue Jun 20 2023 - 16:04:27 EST


From: Benjamin Bara <benjamin.bara@xxxxxxxxxxx>

The monitors of the da9063 must be disabled while the respective
regulator is disabled. Use the new property '.mon_disable_reg_disabled'
to activate the handling in the core.

Signed-off-by: Benjamin Bara <benjamin.bara@xxxxxxxxxxx>
---
drivers/regulator/da9063-regulator.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index 071b368f154f..0e28ed15ebc3 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -1055,6 +1055,10 @@ static int da9063_regulator_probe(struct platform_device *pdev)
return ret;
}

+ /* da9063 requires disabled monitors while reg is disabled. */
+ regl->desc.mon_disable_reg_disabled = REGULATOR_MONITOR_OVER_VOLTAGE |
+ REGULATOR_MONITOR_UNDER_VOLTAGE;
+
regl->rdev = devm_regulator_register(&pdev->dev, &regl->desc,
&config);
if (IS_ERR(regl->rdev)) {

--
2.34.1