|
@@ -1976,9 +1976,18 @@ static int _regulator_disable(struct regulator_dev *rdev)
|
|
|
|
|
|
/* we are last user */
|
|
/* we are last user */
|
|
if (_regulator_can_change_status(rdev)) {
|
|
if (_regulator_can_change_status(rdev)) {
|
|
|
|
+ ret = _notifier_call_chain(rdev,
|
|
|
|
+ REGULATOR_EVENT_PRE_DISABLE,
|
|
|
|
+ NULL);
|
|
|
|
+ if (ret & NOTIFY_STOP_MASK)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
ret = _regulator_do_disable(rdev);
|
|
ret = _regulator_do_disable(rdev);
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
rdev_err(rdev, "failed to disable\n");
|
|
rdev_err(rdev, "failed to disable\n");
|
|
|
|
+ _notifier_call_chain(rdev,
|
|
|
|
+ REGULATOR_EVENT_ABORT_DISABLE,
|
|
|
|
+ NULL);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
|
|
_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
|
|
@@ -2035,9 +2044,16 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
|
|
{
|
|
{
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
|
|
+ ret = _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
|
|
|
|
+ REGULATOR_EVENT_PRE_DISABLE, NULL);
|
|
|
|
+ if (ret & NOTIFY_STOP_MASK)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
ret = _regulator_do_disable(rdev);
|
|
ret = _regulator_do_disable(rdev);
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
rdev_err(rdev, "failed to force disable\n");
|
|
rdev_err(rdev, "failed to force disable\n");
|
|
|
|
+ _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
|
|
|
|
+ REGULATOR_EVENT_ABORT_DISABLE, NULL);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|