diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-01-13 07:33:09 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-02-04 15:49:59 +0100 |
commit | 515fefa8a582d8705770e5b8d592fbaae5e7a4b8 (patch) | |
tree | 28077fe97aeff71201e7feb26bedd08758cb6cbc /include/regulator.h | |
parent | 22f4e94010968a28cb9522a713786839985675ba (diff) | |
download | barebox-515fefa8a582d8705770e5b8d592fbaae5e7a4b8.tar.gz barebox-515fefa8a582d8705770e5b8d592fbaae5e7a4b8.tar.xz |
regulator: allow to use it with non DT device
this will use the device name as regulator name
with the same Algo as clkdev for lookup
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/regulator.h')
-rw-r--r-- | include/regulator.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/regulator.h b/include/regulator.h index 26a5e56046..a43d3df540 100644 --- a/include/regulator.h +++ b/include/regulator.h @@ -15,7 +15,17 @@ struct regulator_ops { int (*is_enabled) (struct regulator_dev *); }; +#ifdef CONFIG_OFDEVICE int of_regulator_register(struct regulator_dev *rd, struct device_node *node); +#else +static inline int of_regulator_register(struct regulator_dev *rd, + struct device_node *node) +{ + return -ENOSYS; +} +#endif +int dev_regulator_register(struct regulator_dev *rd, const char * name, + const char* supply); void regulators_print(void); |