regulator: extend the fixed dummy voltage regulator to accept voltage
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Tue, 19 Jun 2012 15:44:39 +0000 (17:44 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 19 Jun 2012 22:22:30 +0000 (23:22 +0100)
Trivially extend the regulator_register_always_on() helper function to be
even more useful by adding a voltage parameter to it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/fixed-helper.c
include/linux/regulator/fixed.h

index 3aa268dfdb1deb1538aa55546a000cb77795c20c..f9d027992aae119b466efa9ba0ac087ce8739074 100644 (file)
@@ -24,9 +24,10 @@ static void regulator_fixed_release(struct device *dev)
  * @name: name to be used for the regulator
  * @supplies: consumers for this regulator
  * @num_supplies: number of consumers
+ * @uv: voltage in microvolts
  */
 struct platform_device *regulator_register_always_on(int id, const char *name,
-               struct regulator_consumer_supply *supplies, int num_supplies)
+       struct regulator_consumer_supply *supplies, int num_supplies, int uv)
 {
        struct fixed_regulator_data *data;
 
@@ -40,7 +41,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name,
                return NULL;
        }
 
-       data->cfg.microvolts = 0;
+       data->cfg.microvolts = uv;
        data->cfg.gpio = -EINVAL;
        data->cfg.enabled_at_boot = 1;
        data->cfg.init_data = &data->init_data;
index 6b9325b5e371600730879235396a7995f708c62c..680f24e08af2f2c05fa93a5c1fb935be8b3b26a3 100644 (file)
@@ -59,16 +59,16 @@ struct regulator_consumer_supply;
 
 #if IS_ENABLED(CONFIG_REGULATOR)
 struct platform_device *regulator_register_always_on(int id, const char *name,
-               struct regulator_consumer_supply *supplies, int num_supplies);
+               struct regulator_consumer_supply *supplies, int num_supplies, int uv);
 #else
 static inline struct platform_device *regulator_register_always_on(int id, const char *name,
-               struct regulator_consumer_supply *supplies, int num_supplies)
+               struct regulator_consumer_supply *supplies, int num_supplies, int uv)
 {
        return NULL;
 }
 #endif
 
 #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
-                                               "fixed-dummy", s, ns)
+                                               "fixed-dummy", s, ns, 0)
 
 #endif