clk.h 926 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021, STMicroelectronics - All Rights Reserved
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CLK_H
  7. #define CLK_H
  8. #include <stdbool.h>
  9. struct clk_ops {
  10. int (*enable)(unsigned long id);
  11. void (*disable)(unsigned long id);
  12. unsigned long (*get_rate)(unsigned long id);
  13. int (*set_rate)(unsigned long id, unsigned long rate,
  14. unsigned long *orate);
  15. int (*get_parent)(unsigned long id);
  16. int (*set_parent)(unsigned long id, unsigned long parent_id);
  17. bool (*is_enabled)(unsigned long id);
  18. };
  19. int clk_enable(unsigned long id);
  20. void clk_disable(unsigned long id);
  21. unsigned long clk_get_rate(unsigned long id);
  22. int clk_set_rate(unsigned long id, unsigned long rate, unsigned long *orate);
  23. bool clk_is_enabled(unsigned long id);
  24. int clk_get_parent(unsigned long id);
  25. int clk_set_parent(unsigned long id, unsigned long parent_id);
  26. void clk_register(const struct clk_ops *ops);
  27. #endif /* CLK_H */