dcvs_private.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _QCOM_DCVS_PRIVATE_H
  7. #define _QCOM_DCVS_PRIVATE_H
  8. #include <linux/kernel.h>
  9. #include <soc/qcom/dcvs.h>
  10. /*
  11. * NOTE: cur_freq is maintained by SLOW and FAST paths only
  12. * and percpu_cur_freqs is maintained by PERCPU paths only
  13. */
  14. struct dcvs_path {
  15. struct device *dev;
  16. enum dcvs_path_type type;
  17. struct dcvs_hw *hw;
  18. struct dcvs_freq cur_freq;
  19. u32 *percpu_cur_freqs;
  20. struct list_head voter_list;
  21. u32 num_voters;
  22. struct mutex voter_lock;
  23. void *data; /* node-specific private data */
  24. int (*commit_dcvs_freqs)(struct dcvs_path *path,
  25. struct dcvs_freq *freqs,
  26. u32 update_mask);
  27. };
  28. struct dcvs_hw {
  29. struct device *dev;
  30. struct kobject kobj;
  31. enum dcvs_hw_type type;
  32. u32 *freq_table;
  33. u32 table_len;
  34. u32 width;
  35. u32 hw_min_freq;
  36. u32 hw_max_freq;
  37. u32 boost_freq;
  38. struct dcvs_path *dcvs_paths[NUM_DCVS_PATHS];
  39. u32 num_paths;
  40. u32 num_inited_paths;
  41. };
  42. int populate_l3_table(struct device *dev, u32 **freq_table);
  43. int setup_epss_l3_sp_device(struct device *dev, struct dcvs_hw *hw,
  44. struct dcvs_path *path);
  45. int setup_epss_l3_percpu_device(struct device *dev, struct dcvs_hw *hw,
  46. struct dcvs_path *path);
  47. #if IS_ENABLED(CONFIG_QCOM_DCVS_FP)
  48. int setup_ddrllcc_fp_device(struct device *dev, struct dcvs_hw *hw,
  49. struct dcvs_path *path);
  50. #else
  51. static inline int setup_ddrllcc_fp_device(struct device *dev,
  52. struct dcvs_hw *hw, struct dcvs_path *path)
  53. {
  54. return -ENODEV;
  55. }
  56. #endif
  57. int setup_icc_sp_device(struct device *dev, struct dcvs_hw *hw,
  58. struct dcvs_path *path);
  59. #endif /* _QCOM_DCVS_PRIVATE_H */