of_clk.h 819 B

123456789101112131415161718192021222324252627282930313233
  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. struct device_node;
  8. struct of_device_id;
  9. #if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
  10. unsigned int of_clk_get_parent_count(const struct device_node *np);
  11. const char *of_clk_get_parent_name(const struct device_node *np, int index);
  12. void of_clk_init(const struct of_device_id *matches);
  13. #else /* !CONFIG_COMMON_CLK || !CONFIG_OF */
  14. static inline unsigned int of_clk_get_parent_count(const struct device_node *np)
  15. {
  16. return 0;
  17. }
  18. static inline const char *of_clk_get_parent_name(const struct device_node *np,
  19. int index)
  20. {
  21. return NULL;
  22. }
  23. static inline void of_clk_init(const struct of_device_id *matches) {}
  24. #endif /* !CONFIG_COMMON_CLK || !CONFIG_OF */
  25. #endif /* __LINUX_OF_CLK_H */