]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
regulator: core: add event for PRE DISABLE
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 5 Jun 2015 11:44:50 +0000 (17:14 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Wed, 10 Jun 2015 03:20:52 +0000 (20:20 -0700)
Add notification event for the pre-disable of regulator.
This is require to disable IO power of the Tegra IO rails.

bug 200112685

Change-Id: I3a099b584095f178d5cc6a505e4c3860906bcae0
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
(cherry picked from commit 217af244f756ec580dc7a6601e9fe17eb70b8a77)
Reviewed-on: http://git-master/r/754979

drivers/regulator/core.c
include/linux/regulator/consumer.h

index 4dea45b1615b56082a6230c0351d6675330c84a9..d648354008dc42b767fad7e9642f14b602df5ff3 100644 (file)
@@ -2040,6 +2040,8 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
                delay = 0;
        }
 
+       _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_DISABLE, NULL);
+
        trace_regulator_disable(rdev_get_name(rdev));
 
        if (rdev->ena_pin) {
index e6425631f85639258fb61d7b995ee85dc320ee94..2e7895ae604d0b7523fbc693b764494da6faa13e 100644 (file)
@@ -129,6 +129,8 @@ struct notifier_block;
 #define REGULATOR_EVENT_POST_ENABLE            0x200
 #define REGULATOR_EVENT_OUT_PRECHANGE          0x400
 #define REGULATOR_EVENT_OUT_POSTCHANGE         0x800
+#define REGULATOR_EVENT_PRE_DISABLE            0x1000
+#define REGULATOR_EVENT_POST_DISABLE           REGULATOR_EVENT_DISABLE
 
 struct regulator;