mt_lp_rq.h 846 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2023, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_LP_RQ_H
  7. #define MT_LP_RQ_H
  8. /* Determine the generic resource request public type */
  9. #define MT_LP_RQ_XO_FPM BIT(0)
  10. #define MT_LP_RQ_26M BIT(1)
  11. #define MT_LP_RQ_INFRA BIT(2)
  12. #define MT_LP_RQ_SYSPLL BIT(3)
  13. #define MT_LP_RQ_DRAM BIT(4)
  14. #define MT_LP_RQ_ALL (0xFFFFFFFF)
  15. struct mt_lp_resource_user {
  16. /* Determine the resource user mask */
  17. unsigned int umask;
  18. /* Determine the resource request user identify */
  19. unsigned int uid;
  20. /* Request the resource */
  21. int (*request)(struct mt_lp_resource_user *this, unsigned int resource);
  22. /* Release the resource */
  23. int (*release)(struct mt_lp_resource_user *this);
  24. };
  25. int mt_lp_resource_user_register(char *uname, struct mt_lp_resource_user *ru);
  26. #endif /* MT_LP_RQ_H */