Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69612651 authored by David Collins's avatar David Collins Committed by Gerrit - the friendly Code Review server
Browse files

regulator: add notifier event for regulator enable



Add a notifier event which is triggered when a regulator is
enabled.  This can be used by a driver which must configure the
hardware state whenever a given supply is enabled even if some
other consumer was responsible for enabling the supply.

Change-Id: Ic8363308b64953451dd01756e1bfdc2a64527096
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent e4b5be8f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1676,6 +1676,8 @@ static int _regulator_enable(struct regulator_dev *rdev)
			if (ret < 0)
				return ret;

			_notifier_call_chain(rdev, REGULATOR_EVENT_ENABLE,
						NULL);
		} else if (ret < 0) {
			rdev_err(rdev, "is_enabled() failed: %d\n", ret);
			return ret;
+2 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ struct notifier_block;
 * FORCE_DISABLE  Regulator forcibly shut down by software.
 * VOLTAGE_CHANGE Regulator voltage changed.
 * DISABLE        Regulator was disabled.
 * ENABLE         Regulator was enabled.
 *
 * NOTE: These events can be OR'ed together when passed into handler.
 */
@@ -108,6 +109,7 @@ struct notifier_block;
#define REGULATOR_EVENT_FORCE_DISABLE		0x20
#define REGULATOR_EVENT_VOLTAGE_CHANGE		0x40
#define REGULATOR_EVENT_DISABLE 		0x80
#define REGULATOR_EVENT_ENABLE			0x100

struct regulator;