diff mbox series

[3/4] regulator: core: add pre-enable event notify to regulator

Message ID 20210816032003.1162779-4-jay.xu@rock-chips.com (mailing list archive)
State New, archived
Headers show
Series regulator pre-enable | expand

Commit Message

Jianqun Xu Aug. 16, 2021, 3:20 a.m. UTC
Notify the event about regulator to be enabled to driver.

The IO-DOMAIN driver on Rockchip SoCs will take this event and then to
configure the io-domain mode before regualtor_enable.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
 drivers/regulator/core.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index a53f1644a6f4..0eb7af487931 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2654,6 +2654,9 @@  static int _regulator_enable(struct regulator *regulator)
 				goto err_consumer_disable;
 			}
 
+			_notifier_call_chain(rdev, REGULATOR_EVENT_PRE_ENABLE,
+					     NULL);
+
 			ret = _regulator_do_enable(rdev);
 			if (ret < 0)
 				goto err_consumer_disable;