mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
regulator: Add notifier event on regulator disable
The intended use case is for drivers which disable regulators to save power but need to do some work to restore the hardware state when restarting. If the supplies are not actually disabled due to board limits or sharing with other active devices this notifier allows the driver to avoid unneeded reinitialisation, particularly when used with runtime PM. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
committed by
Liam Girdwood
parent
6faa7e0a4b
commit
84b6826306
@@ -1341,6 +1341,9 @@ static int _regulator_disable(struct regulator_dev *rdev)
|
||||
__func__, rdev_get_name(rdev));
|
||||
return ret;
|
||||
}
|
||||
|
||||
_notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* decrease our supplies ref count and disable if required */
|
||||
@@ -1399,8 +1402,8 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
|
||||
return ret;
|
||||
}
|
||||
/* notify other consumers that power has been forced off */
|
||||
_notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE,
|
||||
NULL);
|
||||
_notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
|
||||
REGULATOR_EVENT_DISABLE, NULL);
|
||||
}
|
||||
|
||||
/* decrease our supplies ref count and disable if required */
|
||||
|
||||
Reference in New Issue
Block a user