rk30: sdk add wm8326 support
[firefly-linux-kernel-4.4.55.git] / include / linux / regulator / consumer.h
old mode 100755 (executable)
new mode 100644 (file)
index 73286b2..1951ca8
@@ -35,6 +35,8 @@
 #ifndef __LINUX_REGULATOR_CONSUMER_H_
 #define __LINUX_REGULATOR_CONSUMER_H_
 
+#include <linux/device.h>
+
 /*
  * Regulator operating modes.
  *
@@ -87,8 +89,9 @@
  * REGULATION_OUT Regulator output is out of regulation.
  * FAIL           Regulator output has failed.
  * OVER_TEMP      Regulator over temp.
- * FORCE_DISABLE  Regulator shut down by software.
+ * FORCE_DISABLE  Regulator forcibly shut down by software.
  * VOLTAGE_CHANGE Regulator voltage changed.
+ * DISABLE        Regulator was disabled.
  *
  * NOTE: These events can be OR'ed together when passed into handler.
  */
 #define REGULATOR_EVENT_OVER_TEMP              0x10
 #define REGULATOR_EVENT_FORCE_DISABLE          0x20
 #define REGULATOR_EVENT_VOLTAGE_CHANGE         0x40
+#define REGULATOR_EVENT_DISABLE                0x80
 
 struct regulator;
 
@@ -149,10 +153,13 @@ int regulator_list_voltage(struct regulator *regulator, unsigned selector);
 int regulator_is_supported_voltage(struct regulator *regulator,
                                   int min_uV, int max_uV);
 int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
-
+#ifdef CONFIG_PLAT_RK
 int regulator_set_suspend_voltage(struct regulator *regulator, int uV);
-
+#endif
+int regulator_set_voltage_time(struct regulator *regulator,
+                              int old_uV, int new_uV);
 int regulator_get_voltage(struct regulator *regulator);
+int regulator_sync_voltage(struct regulator *regulator);
 int regulator_set_current_limit(struct regulator *regulator,
                               int min_uA, int max_uA);
 int regulator_get_current_limit(struct regulator *regulator);
@@ -182,9 +189,13 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
 {
        /* Nothing except the stubbed out regulator API should be
         * looking at the value except to check if it is an error
-        * value so the actual return value doesn't matter.
+        * value. Drivers are free to handle NULL specifically by
+        * skipping all regulator API calls, but they don't have to.
+        * Drivers which don't, should make sure they properly handle
+        * corner cases of the API, such as regulator_get_voltage()
+        * returning 0.
         */
-       return (struct regulator *)id;
+       return NULL;
 }
 static inline void regulator_put(struct regulator *regulator)
 {
@@ -234,12 +245,13 @@ static inline int regulator_set_voltage(struct regulator *regulator,
 {
        return 0;
 }
-static int regulator_set_suspend_voltage(struct regulator *regulator, int uV)
-{
-
-
 
+#ifdef CONFIG_PLAT_RK
+static inline int regulator_set_suspend_voltage(struct regulator *regulator, int uV)
+{
+       return 0;
 }
+#endif
 
 static inline int regulator_get_voltage(struct regulator *regulator)
 {