blob: 763953f7e3b8a4f65c7cb8fdd4fdf4ecdc4722e0 [file] [log] [blame]
Rajendra Nayak8f446e62011-11-18 16:47:17 +05301/*
2 * OpenFirmware regulator support routines
3 *
4 */
5
6#ifndef __LINUX_OF_REG_H
7#define __LINUX_OF_REG_H
8
Javier Martinez Canillas072e78b2014-11-10 14:43:53 +01009struct regulator_desc;
10
Thierry Reding1c8fa582012-04-26 16:52:20 +020011struct of_regulator_match {
12 const char *name;
13 void *driver_data;
14 struct regulator_init_data *init_data;
15 struct device_node *of_node;
Javier Martinez Canillas75d6b2f2014-11-10 14:43:54 +010016 const struct regulator_desc *desc;
Thierry Reding1c8fa582012-04-26 16:52:20 +020017};
18
Rajendra Nayak8f446e62011-11-18 16:47:17 +053019#if defined(CONFIG_OF)
20extern struct regulator_init_data
Shawn Guod9a861c2011-12-01 17:21:06 +080021 *of_get_regulator_init_data(struct device *dev,
Javier Martinez Canillas072e78b2014-11-10 14:43:53 +010022 struct device_node *node,
23 const struct regulator_desc *desc);
Thierry Reding1c8fa582012-04-26 16:52:20 +020024extern int of_regulator_match(struct device *dev, struct device_node *node,
25 struct of_regulator_match *matches,
26 unsigned int num_matches);
Rajendra Nayak8f446e62011-11-18 16:47:17 +053027#else
28static inline struct regulator_init_data
Shawn Guod9a861c2011-12-01 17:21:06 +080029 *of_get_regulator_init_data(struct device *dev,
Javier Martinez Canillas072e78b2014-11-10 14:43:53 +010030 struct device_node *node,
31 const struct regulator_desc *desc)
Rajendra Nayak8f446e62011-11-18 16:47:17 +053032{
33 return NULL;
34}
Thierry Reding1c8fa582012-04-26 16:52:20 +020035
36static inline int of_regulator_match(struct device *dev,
37 struct device_node *node,
38 struct of_regulator_match *matches,
39 unsigned int num_matches)
40{
41 return 0;
42}
Rajendra Nayak8f446e62011-11-18 16:47:17 +053043#endif /* CONFIG_OF */
44
45#endif /* __LINUX_OF_REG_H */