of_clk.h 753 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * OF clock helpers
  4. */
  5. #ifndef __LINUX_OF_CLK_H
  6. #define __LINUX_OF_CLK_H
  7. #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
  8. unsigned int of_clk_get_parent_count(struct device_node *np);
  9. const char *of_clk_get_parent_name(struct device_node *np, int index);
  10. void of_clk_init(const struct of_device_id *matches);
  11. #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
  12. static inline unsigned int of_clk_get_parent_count(struct device_node *np)
  13. {
  14. return 0;
  15. }
  16. static inline const char *of_clk_get_parent_name(struct device_node *np,
  17. int index)
  18. {
  19. return NULL;
  20. }
  21. static inline void of_clk_init(const struct of_device_id *matches) {}
  22. #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
  23. #endif /* __LINUX_OF_CLK_H */