Rajendra Nayak | 8f446e6 | 2011-11-18 16:47:17 +0530 | [diff] [blame] | 1 | /* |
| 2 | * OpenFirmware regulator support routines |
| 3 | * |
| 4 | */ |
| 5 | |
| 6 | #ifndef __LINUX_OF_REG_H |
| 7 | #define __LINUX_OF_REG_H |
| 8 | |
Javier Martinez Canillas | 072e78b | 2014-11-10 14:43:53 +0100 | [diff] [blame^] | 9 | struct regulator_desc; |
| 10 | |
Thierry Reding | 1c8fa58 | 2012-04-26 16:52:20 +0200 | [diff] [blame] | 11 | struct 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 Nayak | 8f446e6 | 2011-11-18 16:47:17 +0530 | [diff] [blame] | 18 | #if defined(CONFIG_OF) |
| 19 | extern struct regulator_init_data |
Shawn Guo | d9a861c | 2011-12-01 17:21:06 +0800 | [diff] [blame] | 20 | *of_get_regulator_init_data(struct device *dev, |
Javier Martinez Canillas | 072e78b | 2014-11-10 14:43:53 +0100 | [diff] [blame^] | 21 | struct device_node *node, |
| 22 | const struct regulator_desc *desc); |
Thierry Reding | 1c8fa58 | 2012-04-26 16:52:20 +0200 | [diff] [blame] | 23 | extern int of_regulator_match(struct device *dev, struct device_node *node, |
| 24 | struct of_regulator_match *matches, |
| 25 | unsigned int num_matches); |
Rajendra Nayak | 8f446e6 | 2011-11-18 16:47:17 +0530 | [diff] [blame] | 26 | #else |
| 27 | static inline struct regulator_init_data |
Shawn Guo | d9a861c | 2011-12-01 17:21:06 +0800 | [diff] [blame] | 28 | *of_get_regulator_init_data(struct device *dev, |
Javier Martinez Canillas | 072e78b | 2014-11-10 14:43:53 +0100 | [diff] [blame^] | 29 | struct device_node *node, |
| 30 | const struct regulator_desc *desc) |
Rajendra Nayak | 8f446e6 | 2011-11-18 16:47:17 +0530 | [diff] [blame] | 31 | { |
| 32 | return NULL; |
| 33 | } |
Thierry Reding | 1c8fa58 | 2012-04-26 16:52:20 +0200 | [diff] [blame] | 34 | |
| 35 | static 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 Nayak | 8f446e6 | 2011-11-18 16:47:17 +0530 | [diff] [blame] | 42 | #endif /* CONFIG_OF */ |
| 43 | |
| 44 | #endif /* __LINUX_OF_REG_H */ |