Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * OF clock helpers
0004  */
0005 
0006 #ifndef __LINUX_OF_CLK_H
0007 #define __LINUX_OF_CLK_H
0008 
0009 struct device_node;
0010 struct of_device_id;
0011 
0012 #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
0013 
0014 unsigned int of_clk_get_parent_count(const struct device_node *np);
0015 const char *of_clk_get_parent_name(const struct device_node *np, int index);
0016 void of_clk_init(const struct of_device_id *matches);
0017 
0018 #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
0019 
0020 static inline unsigned int of_clk_get_parent_count(const struct device_node *np)
0021 {
0022     return 0;
0023 }
0024 static inline const char *of_clk_get_parent_name(const struct device_node *np,
0025                          int index)
0026 {
0027     return NULL;
0028 }
0029 static inline void of_clk_init(const struct of_device_id *matches) {}
0030 
0031 #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
0032 
0033 #endif /* __LINUX_OF_CLK_H */