[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250113122104.3870673-2-zhenglifeng1@huawei.com>
Date: Mon, 13 Jan 2025 20:20:59 +0800
From: Lifeng Zheng <zhenglifeng1@...wei.com>
To: <rafael@...nel.org>, <lenb@...nel.org>, <robert.moore@...el.com>,
<viresh.kumar@...aro.org>, <mario.limonciello@....com>,
<gautham.shenoy@....com>, <ray.huang@....com>, <pierre.gondois@....com>
CC: <acpica-devel@...ts.linux.dev>, <linux-acpi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<linuxarm@...wei.com>, <jonathan.cameron@...wei.com>,
<zhanjie9@...ilicon.com>, <lihuisong@...wei.com>, <zhenglifeng1@...wei.com>,
<hepeng68@...wei.com>, <fanghao11@...wei.com>
Subject: [PATCH v4 1/6] ACPI: CPPC: Add IS_OPTIONAL_CPC_REG macro
Add IS_OPTIONAL_CPC_REG macro to judge if a cpc_reg is an optional one.
Signed-off-by: Lifeng Zheng <zhenglifeng1@...wei.com>
---
drivers/acpi/cppc_acpi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index f193e713825a..6454b469338f 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -129,6 +129,12 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
#define CPC_SUPPORTED(cpc) ((cpc)->type == ACPI_TYPE_INTEGER ? \
!!(cpc)->cpc_entry.int_value : \
!IS_NULL_REG(&(cpc)->cpc_entry.reg))
+
+/* These indicate optional of the per-cpu cpc_regs[]. */
+#define REG_OPTIONAL (0b111111100011111010000)
+
+#define IS_OPTIONAL_CPC_REG(reg_idx) (REG_OPTIONAL & (1U << (reg_idx)))
+
/*
* Arbitrary Retries in case the remote processor is slow to respond
* to PCC commands. Keeping it high enough to cover emulators where
--
2.33.0
Powered by blists - more mailing lists