diff options
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 49deeaefb13c..8791bbef4587 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1340,6 +1340,8 @@ static int _regulator_enable(struct regulator_dev *rdev) } trace_regulator_enable(rdev_get_name(rdev)); + _notifier_call_chain( + rdev, REGULATOR_EVENT_PRE_ENABLE, NULL); /* Allow the regulator to ramp; it would be useful * to extend this for bulk operations so that the @@ -1357,6 +1359,8 @@ static int _regulator_enable(struct regulator_dev *rdev) udelay(delay); } + _notifier_call_chain( + rdev, REGULATOR_EVENT_POST_ENABLE, NULL); trace_regulator_enable_complete(rdev_get_name(rdev)); } else if (ret < 0) { @@ -1672,8 +1676,16 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) if (ret < 0) goto out; + if (_regulator_is_enabled(rdev)) + _notifier_call_chain( + rdev, REGULATOR_EVENT_OUT_PRECHANGE, NULL); + ret = rdev->desc->ops->set_voltage(rdev, min_uV, max_uV); + if (_regulator_is_enabled(rdev)) + _notifier_call_chain( + rdev, REGULATOR_EVENT_OUT_POSTCHANGE, NULL); + trace_regulator_set_voltage_complete(rdev_get_name(rdev), -1); out: |