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