Skip to contentSkip to conversation

Applied "regulator: core: Add new notification for enabling of regulator" to the regulator tree

PATCH Mark Brown 1 participant 1 message Mar 27, 2017 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

The patch

regulator: core: Add new notification for enabling of regulator

has been applied to the regulator tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 264b88c9e5c86c92ca1d67689779362760baf651 Mon Sep 17 00:00:00 2001

From: Harald Geyer <[email protected]>
Date: Thu, 23 Feb 2017 17:06:52 +0000
Subject: [PATCH] regulator: core: Add new notification for enabling of
regulator

This is useful for devices, which need some time to start up, to help the drivers track how long the supply has been up already. Ie whether it can safely talk to the HW or needs to wait.

---
 drivers/regulator/core.c           | 2 ++
 include/linux/regulator/consumer.h | 1 +
 2 files changed, 3 insertions(+)
drivers/regulator/core.c +2 -0
index 04baac9a165b..6b9bb1b00226 100644
@@ -2162,6 +2162,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;
include/linux/regulator/consumer.h +1 -0
index ea0fffa5faeb..df176d7c2b87 100644
@@ -119,6 +119,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
 
 /*
  * Regulator errors that can be queried using regulator_get_error_flags
Signature · 1 line
2.11.0