blob: 8d1d136c0fb9cd35fbb73e063dae696c2e39cd41 [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;
16};
17
Rajendra Nayak8f446e62011-11-18 16:47:17 +053018#if defined(CONFIG_OF)
19extern struct regulator_init_data
Shawn Guod9a861c2011-12-01 17:21:06 +080020 *of_get_regulator_init_data(struct device *dev,
Javier Martinez Canillas072e78b2014-11-10 14:43:53 +010021 struct device_node *node,
22 const struct regulator_desc *desc);
Thierry Reding1c8fa582012-04-26 16:52:20 +020023extern int of_regulator_match(struct device *dev, struct device_node *node,
24 struct of_regulator_match *matches,
25 unsigned int num_matches);
Rajendra Nayak8f446e62011-11-18 16:47:17 +053026#else
27static inline struct regulator_init_data
Shawn Guod9a861c2011-12-01 17:21:06 +080028 *of_get_regulator_init_data(struct device *dev,
Javier Martinez Canillas072e78b2014-11-10 14:43:53 +010029 struct device_node *node,
30 const struct regulator_desc *desc)
Rajendra Nayak8f446e62011-11-18 16:47:17 +053031{
32 return NULL;
33}
Thierry Reding1c8fa582012-04-26 16:52:20 +020034
35static inline int of_regulator_match(struct device *dev,
36 struct device_node *node,
37 struct of_regulator_match *matches,
38 unsigned int num_matches)
39{
40 return 0;
41}
Rajendra Nayak8f446e62011-11-18 16:47:17 +053042#endif /* CONFIG_OF */
43
44#endif /* __LINUX_OF_REG_H */