bolero-clk-rsc.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2019, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef BOLERO_CLK_RSC_H
  7. #define BOLERO_CLK_RSC_H
  8. #include <linux/regmap.h>
  9. #include <bindings/qcom,bolero-clk-rsc.h>
  10. #if IS_ENABLED(CONFIG_SND_SOC_BOLERO)
  11. int bolero_clk_rsc_mgr_init(void);
  12. void bolero_clk_rsc_mgr_exit(void);
  13. void bolero_clk_rsc_fs_gen_request(struct device *dev,
  14. bool enable);
  15. int bolero_clk_rsc_request_clock(struct device *dev,
  16. int default_clk_id,
  17. int clk_id_req,
  18. bool enable);
  19. int bolero_rsc_clk_reset(struct device *dev, int clk_id);
  20. void bolero_clk_rsc_enable_all_clocks(struct device *dev, bool enable);
  21. #else
  22. static inline void bolero_clk_rsc_fs_gen_request(struct device *dev,
  23. bool enable)
  24. {
  25. }
  26. static inline int bolero_clk_rsc_mgr_init(void)
  27. {
  28. return 0;
  29. }
  30. static inline void bolero_clk_rsc_mgr_exit(void)
  31. {
  32. }
  33. static inline int bolero_clk_rsc_request_clock(struct device *dev,
  34. int default_clk_id,
  35. int clk_id_req,
  36. bool enable)
  37. {
  38. return 0;
  39. }
  40. static inline int bolero_rsc_clk_reset(struct device *dev, int clk_id)
  41. {
  42. return 0;
  43. }
  44. static inline void bolero_clk_rsc_enable_all_clocks(struct device *dev,
  45. bool enable)
  46. {
  47. return;
  48. }
  49. #endif /* CONFIG_SND_SOC_BOLERO */
  50. #endif /* BOLERO_CLK_RSC_H */