]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: core: Add new notification for enabling of regulator
authorHarald Geyer <harald@ccbib.org>
Thu, 23 Feb 2017 17:06:52 +0000 (17:06 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 24 Mar 2017 19:13:42 +0000 (19:13 +0000)
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.

Signed-off-by: Harald Geyer <harald@ccbib.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
include/linux/regulator/consumer.h

index 04baac9a165bbb56da292a51d0a56055947861e0..6b9bb1b002260e7e9ac15ea1e8c0a30da0be8923 100644 (file)
@@ -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;
index ea0fffa5faebb1688ecdb6166db8c7f4d2836c40..df176d7c2b87c00356a11b383a61185e7f3e47ae 100644 (file)
@@ -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