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