]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
8f446e6f RN |
2 | /* |
3 | * OpenFirmware regulator support routines | |
4 | * | |
5 | */ | |
6 | ||
7 | #ifndef __LINUX_OF_REG_H | |
8 | #define __LINUX_OF_REG_H | |
9 | ||
072e78b1 JMC |
10 | struct regulator_desc; |
11 | ||
1c8fa58f TR |
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; | |
75d6b2fa | 17 | const struct regulator_desc *desc; |
1c8fa58f TR |
18 | }; |
19 | ||
8f446e6f RN |
20 | #if defined(CONFIG_OF) |
21 | extern struct regulator_init_data | |
d9a861cc | 22 | *of_get_regulator_init_data(struct device *dev, |
072e78b1 JMC |
23 | struct device_node *node, |
24 | const struct regulator_desc *desc); | |
1c8fa58f TR |
25 | extern int of_regulator_match(struct device *dev, struct device_node *node, |
26 | struct of_regulator_match *matches, | |
27 | unsigned int num_matches); | |
8f446e6f RN |
28 | #else |
29 | static inline struct regulator_init_data | |
d9a861cc | 30 | *of_get_regulator_init_data(struct device *dev, |
072e78b1 JMC |
31 | struct device_node *node, |
32 | const struct regulator_desc *desc) | |
8f446e6f RN |
33 | { |
34 | return NULL; | |
35 | } | |
1c8fa58f TR |
36 | |
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) | |
41 | { | |
42 | return 0; | |
43 | } | |
8f446e6f RN |
44 | #endif /* CONFIG_OF */ |
45 | ||
46 | #endif /* __LINUX_OF_REG_H */ |