Geert Uytterhoeven | eb06d6b | 2018-04-18 16:50:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * OF clock helpers |
| 4 | */ |
| 5 | |
| 6 | #ifndef __LINUX_OF_CLK_H |
| 7 | #define __LINUX_OF_CLK_H |
| 8 | |
Geert Uytterhoeven | 5df8671 | 2020-02-05 20:46:49 +0100 | [diff] [blame^] | 9 | struct device_node; |
| 10 | struct of_device_id; |
| 11 | |
Geert Uytterhoeven | eb06d6b | 2018-04-18 16:50:01 +0200 | [diff] [blame] | 12 | #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) |
| 13 | |
| 14 | unsigned int of_clk_get_parent_count(struct device_node *np); |
| 15 | const char *of_clk_get_parent_name(struct device_node *np, int index); |
| 16 | void of_clk_init(const struct of_device_id *matches); |
| 17 | |
| 18 | #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ |
| 19 | |
| 20 | static inline unsigned int of_clk_get_parent_count(struct device_node *np) |
| 21 | { |
| 22 | return 0; |
| 23 | } |
| 24 | static inline const char *of_clk_get_parent_name(struct device_node *np, |
| 25 | int index) |
| 26 | { |
| 27 | return NULL; |
| 28 | } |
| 29 | static inline void of_clk_init(const struct of_device_id *matches) {} |
| 30 | |
| 31 | #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */ |
| 32 | |
| 33 | #endif /* __LINUX_OF_CLK_H */ |