diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-04-18 10:50:01 -0400 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2018-05-02 11:31:07 -0400 |
| commit | eb06d6bbc45a7561de78a00fb17bfbb75893ee26 (patch) | |
| tree | a5e299d56b1be6444464fa079076559ee42f74fe /include/linux/of_clk.h | |
| parent | 60cc43fc888428bb2f18f08997432d426a243338 (diff) | |
clk: Extract OF clock helpers in <linux/of_clk.h>
The use of of_clk_get_parent_{count,name}() and of_clk_init() is not
limited to clock providers.
Hence move these helpers into their own header file, so callers that are
not clock providers no longer have to include <linux/clk-provider.h>.
Suggested-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'include/linux/of_clk.h')
| -rw-r--r-- | include/linux/of_clk.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/of_clk.h b/include/linux/of_clk.h new file mode 100644 index 000000000000..b27da9f164cb --- /dev/null +++ b/include/linux/of_clk.h | |||
| @@ -0,0 +1,30 @@ | |||
| 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 | |||
| 9 | #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF) | ||
| 10 | |||
| 11 | unsigned int of_clk_get_parent_count(struct device_node *np); | ||
| 12 | const char *of_clk_get_parent_name(struct device_node *np, int index); | ||
| 13 | void of_clk_init(const struct of_device_id *matches); | ||
| 14 | |||
| 15 | #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */ | ||
| 16 | |||
| 17 | static inline unsigned int of_clk_get_parent_count(struct device_node *np) | ||
| 18 | { | ||
| 19 | return 0; | ||
| 20 | } | ||
| 21 | static inline const char *of_clk_get_parent_name(struct device_node *np, | ||
| 22 | int index) | ||
| 23 | { | ||
| 24 | return NULL; | ||
| 25 | } | ||
| 26 | static inline void of_clk_init(const struct of_device_id *matches) {} | ||
| 27 | |||
| 28 | #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */ | ||
| 29 | |||
| 30 | #endif /* __LINUX_OF_CLK_H */ | ||
