Commit 15719ccc authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown

regulator: extend the fixed dummy voltage regulator to accept voltage

Trivially extend the regulator_register_always_on() helper function to be
even more useful by adding a voltage parameter to it.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent dfad84ae
...@@ -24,9 +24,10 @@ static void regulator_fixed_release(struct device *dev) ...@@ -24,9 +24,10 @@ static void regulator_fixed_release(struct device *dev)
* @name: name to be used for the regulator * @name: name to be used for the regulator
* @supplies: consumers for this regulator * @supplies: consumers for this regulator
* @num_supplies: number of consumers * @num_supplies: number of consumers
* @uv: voltage in microvolts
*/ */
struct platform_device *regulator_register_always_on(int id, const char *name, 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; struct fixed_regulator_data *data;
...@@ -40,7 +41,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name, ...@@ -40,7 +41,7 @@ struct platform_device *regulator_register_always_on(int id, const char *name,
return NULL; return NULL;
} }
data->cfg.microvolts = 0; data->cfg.microvolts = uv;
data->cfg.gpio = -EINVAL; data->cfg.gpio = -EINVAL;
data->cfg.enabled_at_boot = 1; data->cfg.enabled_at_boot = 1;
data->cfg.init_data = &data->init_data; data->cfg.init_data = &data->init_data;
......
...@@ -59,16 +59,16 @@ struct regulator_consumer_supply; ...@@ -59,16 +59,16 @@ struct regulator_consumer_supply;
#if IS_ENABLED(CONFIG_REGULATOR) #if IS_ENABLED(CONFIG_REGULATOR)
struct platform_device *regulator_register_always_on(int id, const char *name, 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 #else
static inline struct platform_device *regulator_register_always_on(int id, const char *name, 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; return NULL;
} }
#endif #endif
#define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \ #define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
"fixed-dummy", s, ns) "fixed-dummy", s, ns, 0)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment