MLK-11395-3 regulator: consumer: add new event macros
authorFancy Fang <chen.fang@freescale.com>
Fri, 21 Aug 2015 06:19:27 +0000 (14:19 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:05 +0000 (14:48 -0500)
Add two new regulator events macro 'REGULATOR_EVENT_PRE_DO_ENABLE'
and 'REGULATOR_EVENT_PRE_DO_DISABLE', since some gpc operations
should be required when MIPI PHY is powered on/off.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
drivers/regulator/core.c
include/linux/regulator/consumer.h

index 9403245..852ff1c 100644 (file)
@@ -2075,6 +2075,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
 {
        int ret, delay;
 
+       _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_DO_ENABLE, NULL);
        /* Query before enabling in case configuration dependent.  */
        ret = _regulator_get_enable_time(rdev);
        if (ret >= 0) {
@@ -2213,6 +2214,7 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
 {
        int ret;
 
+       _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_DO_DISABLE, NULL);
        trace_regulator_disable(rdev_get_name(rdev));
 
        if (rdev->ena_pin) {
index 6921082..2cfbe0f 100644 (file)
@@ -119,6 +119,8 @@ struct regmap;
 #define REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE   0x200
 #define REGULATOR_EVENT_PRE_DISABLE            0x400
 #define REGULATOR_EVENT_ABORT_DISABLE          0x800
+#define REGULATOR_EVENT_PRE_DO_ENABLE          0x1000
+#define REGULATOR_EVENT_PRE_DO_DISABLE         0x2000
 
 /**
  * struct pre_voltage_change_data - Data sent with PRE_VOLTAGE_CHANGE event