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

Commit 10a218a6 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 781d2db4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2163,6 +2163,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
@@ -103,6 +103,7 @@ struct regmap;
 *                      Data passed is old voltage cast to (void *).
 * PRE_DISABLE    Regulator is about to be disabled
 * ABORT_DISABLE  Regulator disable failed for some reason
 * ENABLE         Regulator was enabled.
 *
 * NOTE: These events can be OR'ed together when passed into handler.
 */
@@ -119,6 +120,7 @@ struct regmap;
#define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE	0x200
#define REGULATOR_EVENT_PRE_DISABLE		0x400
#define REGULATOR_EVENT_ABORT_DISABLE		0x800
#define REGULATOR_EVENT_ENABLE			0x1000

/**
 * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event