1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_GT_IDLE_SYSFS_TYPES_H_
7 #define _XE_GT_IDLE_SYSFS_TYPES_H_
8 
9 #include <linux/spinlock.h>
10 #include <linux/types.h>
11 
12 struct xe_guc_pc;
13 
14 /* States of GT Idle */
15 enum xe_gt_idle_state {
16 	GT_IDLE_C0,
17 	GT_IDLE_C6,
18 	GT_IDLE_UNKNOWN,
19 };
20 
21 /**
22  * struct xe_gt_idle - A struct that contains idle properties based of gt
23  */
24 struct xe_gt_idle {
25 	/** @name: name */
26 	char name[16];
27 	/** @powergate_enable: copy of powergate enable bits */
28 	u32 powergate_enable;
29 	/** @residency_multiplier: residency multiplier in ns */
30 	u32 residency_multiplier;
31 	/** @cur_residency: raw driver copy of idle residency */
32 	u64 cur_residency;
33 	/** @prev_residency: previous residency counter */
34 	u64 prev_residency;
35 	/** @lock: Lock protecting idle residency counters */
36 	raw_spinlock_t lock;
37 	/** @idle_status: get the current idle state */
38 	enum xe_gt_idle_state (*idle_status)(struct xe_guc_pc *pc);
39 	/** @idle_residency: get idle residency counter */
40 	u64 (*idle_residency)(struct xe_guc_pc *pc);
41 };
42 
43 #endif /* _XE_GT_IDLE_SYSFS_TYPES_H_ */
44