Linux 4.16-rc1
[cris-mirror.git] / include / linux / regulator / of_regulator.h
blobdf7f154a2ed588a0e172e2889c2163c75c8bb8ad
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * OpenFirmware regulator support routines
5 */
7 #ifndef __LINUX_OF_REG_H
8 #define __LINUX_OF_REG_H
10 struct regulator_desc;
12 struct of_regulator_match {
13 const char *name;
14 void *driver_data;
15 struct regulator_init_data *init_data;
16 struct device_node *of_node;
17 const struct regulator_desc *desc;
20 #if defined(CONFIG_OF)
21 extern struct regulator_init_data
22 *of_get_regulator_init_data(struct device *dev,
23 struct device_node *node,
24 const struct regulator_desc *desc);
25 extern int of_regulator_match(struct device *dev, struct device_node *node,
26 struct of_regulator_match *matches,
27 unsigned int num_matches);
28 #else
29 static inline struct regulator_init_data
30 *of_get_regulator_init_data(struct device *dev,
31 struct device_node *node,
32 const struct regulator_desc *desc)
34 return NULL;
37 static inline int of_regulator_match(struct device *dev,
38 struct device_node *node,
39 struct of_regulator_match *matches,
40 unsigned int num_matches)
42 return 0;
44 #endif /* CONFIG_OF */
46 #endif /* __LINUX_OF_REG_H */