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