regulator: support multiple dummy fixed regulators
Currently regulator_register_fixed() uses a constant name to register a fixed dummy regulator. This is sufficient in principle, since there is no reason to register multiple such regulators. The user can simply supply all consumers in one array and use it to initialise such a regulator. However, in some cases it can be convenient to register multiple such regulators. This is also a prerequisite for the upcoming patch, that will add a voltage parameter to this function. The original function is provided as a wrapper macro. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
485802a6c5
commit
dfad84aeab
2 changed files with 16 additions and 5 deletions
|
|
@ -58,14 +58,17 @@ struct fixed_voltage_config {
|
|||
struct regulator_consumer_supply;
|
||||
|
||||
#if IS_ENABLED(CONFIG_REGULATOR)
|
||||
struct platform_device *regulator_register_fixed(int id,
|
||||
struct platform_device *regulator_register_always_on(int id, const char *name,
|
||||
struct regulator_consumer_supply *supplies, int num_supplies);
|
||||
#else
|
||||
static inline struct platform_device *regulator_register_fixed(int id,
|
||||
static inline struct platform_device *regulator_register_always_on(int id, const char *name,
|
||||
struct regulator_consumer_supply *supplies, int num_supplies)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define regulator_register_fixed(id, s, ns) regulator_register_always_on(id, \
|
||||
"fixed-dummy", s, ns)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue