device.h: audit and cleanup users in main include dir
[linux-2.6.git] / include / linux / regulator / consumer.h
index 28c9fd0..10e0d33 100644 (file)
@@ -35,7 +35,8 @@
 #ifndef __LINUX_REGULATOR_CONSUMER_H_
 #define __LINUX_REGULATOR_CONSUMER_H_
 
-#include <linux/device.h>
+struct device;
+struct notifier_block;
 
 /*
  * Regulator operating modes.
@@ -122,6 +123,9 @@ struct regulator;
 struct regulator_bulk_data {
        const char *supply;
        struct regulator *consumer;
+
+       /* private: Internal use */
+       int ret;
 };
 
 #if defined(CONFIG_REGULATOR)
@@ -138,6 +142,7 @@ int regulator_enable(struct regulator *regulator);
 int regulator_disable(struct regulator *regulator);
 int regulator_force_disable(struct regulator *regulator);
 int regulator_is_enabled(struct regulator *regulator);
+int regulator_disable_deferred(struct regulator *regulator, int ms);
 
 int regulator_bulk_get(struct device *dev, int num_consumers,
                       struct regulator_bulk_data *consumers);
@@ -145,6 +150,8 @@ int regulator_bulk_enable(int num_consumers,
                          struct regulator_bulk_data *consumers);
 int regulator_bulk_disable(int num_consumers,
                           struct regulator_bulk_data *consumers);
+int regulator_bulk_force_disable(int num_consumers,
+                          struct regulator_bulk_data *consumers);
 void regulator_bulk_free(int num_consumers,
                         struct regulator_bulk_data *consumers);
 
@@ -153,7 +160,10 @@ 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);
+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);
@@ -183,9 +193,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)
 {
@@ -201,6 +215,17 @@ static inline int regulator_disable(struct regulator *regulator)
        return 0;
 }
 
+static inline int regulator_force_disable(struct regulator *regulator)
+{
+       return 0;
+}
+
+static inline int regulator_disable_deferred(struct regulator *regulator,
+                                            int ms)
+{
+       return 0;
+}
+
 static inline int regulator_is_enabled(struct regulator *regulator)
 {
        return 1;
@@ -225,6 +250,12 @@ static inline int regulator_bulk_disable(int num_consumers,
        return 0;
 }
 
+static inline int regulator_bulk_force_disable(int num_consumers,
+                                       struct regulator_bulk_data *consumers)
+{
+       return 0;
+}
+
 static inline void regulator_bulk_free(int num_consumers,
                                       struct regulator_bulk_data *consumers)
 {