xref: /linux-6.15/include/linux/of_clk.h (revision 4a4472fd)
1eb06d6bbSGeert Uytterhoeven /* SPDX-License-Identifier: GPL-2.0 */
2eb06d6bbSGeert Uytterhoeven /*
3eb06d6bbSGeert Uytterhoeven  * OF clock helpers
4eb06d6bbSGeert Uytterhoeven  */
5eb06d6bbSGeert Uytterhoeven 
6eb06d6bbSGeert Uytterhoeven #ifndef __LINUX_OF_CLK_H
7eb06d6bbSGeert Uytterhoeven #define __LINUX_OF_CLK_H
8eb06d6bbSGeert Uytterhoeven 
95df86714SGeert Uytterhoeven struct device_node;
105df86714SGeert Uytterhoeven struct of_device_id;
115df86714SGeert Uytterhoeven 
12eb06d6bbSGeert Uytterhoeven #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
13eb06d6bbSGeert Uytterhoeven 
14*4a4472fdSGeert Uytterhoeven unsigned int of_clk_get_parent_count(const struct device_node *np);
15*4a4472fdSGeert Uytterhoeven const char *of_clk_get_parent_name(const struct device_node *np, int index);
16eb06d6bbSGeert Uytterhoeven void of_clk_init(const struct of_device_id *matches);
17eb06d6bbSGeert Uytterhoeven 
18eb06d6bbSGeert Uytterhoeven #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
19eb06d6bbSGeert Uytterhoeven 
of_clk_get_parent_count(const struct device_node * np)20*4a4472fdSGeert Uytterhoeven static inline unsigned int of_clk_get_parent_count(const struct device_node *np)
21eb06d6bbSGeert Uytterhoeven {
22eb06d6bbSGeert Uytterhoeven 	return 0;
23eb06d6bbSGeert Uytterhoeven }
of_clk_get_parent_name(const struct device_node * np,int index)24*4a4472fdSGeert Uytterhoeven static inline const char *of_clk_get_parent_name(const struct device_node *np,
25eb06d6bbSGeert Uytterhoeven 						 int index)
26eb06d6bbSGeert Uytterhoeven {
27eb06d6bbSGeert Uytterhoeven 	return NULL;
28eb06d6bbSGeert Uytterhoeven }
of_clk_init(const struct of_device_id * matches)29eb06d6bbSGeert Uytterhoeven static inline void of_clk_init(const struct of_device_id *matches) {}
30eb06d6bbSGeert Uytterhoeven 
31eb06d6bbSGeert Uytterhoeven #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
32eb06d6bbSGeert Uytterhoeven 
33eb06d6bbSGeert Uytterhoeven #endif /* __LINUX_OF_CLK_H */
34