ccu_frac.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016 Maxime Ripard. All rights reserved.
  4. */
  5. #ifndef _CCU_FRAC_H_
  6. #define _CCU_FRAC_H_
  7. #include <linux/clk-provider.h>
  8. #include "ccu_common.h"
  9. struct ccu_frac_internal {
  10. u32 enable;
  11. u32 select;
  12. unsigned long rates[2];
  13. };
  14. #define _SUNXI_CCU_FRAC(_enable, _select, _rate1, _rate2) \
  15. { \
  16. .enable = _enable, \
  17. .select = _select, \
  18. .rates = { _rate1, _rate2 }, \
  19. }
  20. bool ccu_frac_helper_is_enabled(struct ccu_common *common,
  21. struct ccu_frac_internal *cf);
  22. void ccu_frac_helper_enable(struct ccu_common *common,
  23. struct ccu_frac_internal *cf);
  24. void ccu_frac_helper_disable(struct ccu_common *common,
  25. struct ccu_frac_internal *cf);
  26. bool ccu_frac_helper_has_rate(struct ccu_common *common,
  27. struct ccu_frac_internal *cf,
  28. unsigned long rate);
  29. unsigned long ccu_frac_helper_read_rate(struct ccu_common *common,
  30. struct ccu_frac_internal *cf);
  31. int ccu_frac_helper_set_rate(struct ccu_common *common,
  32. struct ccu_frac_internal *cf,
  33. unsigned long rate, u32 lock);
  34. #endif /* _CCU_FRAC_H_ */