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

Commit 01f8ba7f authored by David Collins's avatar David Collins Committed by Rohit Vaswani
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>
Signed-off-by: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
[osvaldob: resolve trivial merge conflicts]
Signed-off-by: default avatarOsvaldo Banuelos <osvaldob@codeaurora.org>
[adharmap: 0x100 was taken by PRE_VOLTAGE_CHANGE use 0x1000 for ENABLE]
parent 0a9312ff
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2109,6 +2109,8 @@ static int _regulator_enable(struct regulator_dev *rdev)
			if (ret < 0)
			if (ret < 0)
				return ret;
				return ret;


			_notifier_call_chain(rdev, REGULATOR_EVENT_ENABLE,
						NULL);
		} else if (ret < 0) {
		} else if (ret < 0) {
			rdev_err(rdev, "is_enabled() failed: %d\n", ret);
			rdev_err(rdev, "is_enabled() failed: %d\n", ret);
			return ret;
			return ret;
+2 −0
Original line number Original line Diff line number Diff line
@@ -103,6 +103,7 @@ struct regmap;
 *                      Data passed is old voltage cast to (void *).
 *                      Data passed is old voltage cast to (void *).
 * PRE_DISABLE    Regulator is about to be disabled
 * PRE_DISABLE    Regulator is about to be disabled
 * ABORT_DISABLE  Regulator disable failed for some reason
 * ABORT_DISABLE  Regulator disable failed for some reason
 * ENABLE         Regulator was enabled.
 *
 *
 * NOTE: These events can be OR'ed together when passed into handler.
 * 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_ABORT_VOLTAGE_CHANGE	0x200
#define REGULATOR_EVENT_PRE_DISABLE		0x400
#define REGULATOR_EVENT_PRE_DISABLE		0x400
#define REGULATOR_EVENT_ABORT_DISABLE		0x800
#define REGULATOR_EVENT_ABORT_DISABLE		0x800
#define REGULATOR_EVENT_ENABLE			0x1000


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