提交 264b88c9 编写于 作者: H Harald Geyer 提交者: Mark Brown

regulator: core: Add new notification for enabling of regulator

This is useful for devices, which need some time to start up, to help
the drivers track how long the supply has been up already. Ie whether
it can safely talk to the HW or needs to wait.
Signed-off-by: NHarald Geyer <harald@ccbib.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 d00b7461
...@@ -2162,6 +2162,8 @@ static int _regulator_enable(struct regulator_dev *rdev) ...@@ -2162,6 +2162,8 @@ static int _regulator_enable(struct regulator_dev *rdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
_notifier_call_chain(rdev, REGULATOR_EVENT_ENABLE,
NULL);
} else if (ret < 0) { } else if (ret < 0) {
rdev_err(rdev, "is_enabled() failed: %d\n", ret); rdev_err(rdev, "is_enabled() failed: %d\n", ret);
return ret; return ret;
......
...@@ -119,6 +119,7 @@ struct regmap; ...@@ -119,6 +119,7 @@ struct regmap;
#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200 #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE 0x200
#define REGULATOR_EVENT_PRE_DISABLE 0x400 #define REGULATOR_EVENT_PRE_DISABLE 0x400
#define REGULATOR_EVENT_ABORT_DISABLE 0x800 #define REGULATOR_EVENT_ABORT_DISABLE 0x800
#define REGULATOR_EVENT_ENABLE 0x1000
/* /*
* Regulator errors that can be queried using regulator_get_error_flags * Regulator errors that can be queried using regulator_get_error_flags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册