Skip to content

Commit e3d7935

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
ACPI: CPPC: Add IS_OPTIONAL_CPC_REG macro to judge if a cpc_reg is optional
In ACPI 6.5, s8.4.6.1 _CPC (Continuous Performance Control), whether each of the per-cpu cpc_regs[] is mandatory or optional is defined. Since the CPC_SUPPORTED() check is only for optional _CPC fields, another macro to check if the field is optional is needed. Reviewed-by: Pierre Gondois <[email protected]> Signed-off-by: Lifeng Zheng <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3a3ce10 commit e3d7935

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/acpi/cppc_acpi.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
128128
#define CPC_SUPPORTED(cpc) ((cpc)->type == ACPI_TYPE_INTEGER ? \
129129
!!(cpc)->cpc_entry.int_value : \
130130
!IS_NULL_REG(&(cpc)->cpc_entry.reg))
131+
132+
/*
133+
* Each bit indicates the optionality of the register in per-cpu
134+
* cpc_regs[] with the corresponding index. 0 means mandatory and 1
135+
* means optional.
136+
*/
137+
#define REG_OPTIONAL (0x1FC7D0)
138+
139+
/*
140+
* Use the index of the register in per-cpu cpc_regs[] to check if
141+
* it's an optional one.
142+
*/
143+
#define IS_OPTIONAL_CPC_REG(reg_idx) (REG_OPTIONAL & (1U << (reg_idx)))
144+
131145
/*
132146
* Arbitrary Retries in case the remote processor is slow to respond
133147
* to PCC commands. Keeping it high enough to cover emulators where

0 commit comments

Comments
 (0)