[PATCH v8 06/13] firmware: arm_scmi: Add SCMIV4.0 Powercap notifications support
Philip Radford <[email protected]> Wed, 1 Jul 2026 12:57:40 +0000
| Newsgroups | org.kernel.vger.arm-scmi,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
From: Cristian Marussi <[email protected]> Extend notification support to the new SCMIv4.0 Powercap format that carry also a CPL identifier where specified. Since this addition completes SCMIv4.0 Powercap support bump also the protocol version define. Signed-off-by: Cristian Marussi <[email protected]> Signed-off-by: Philip Radford <[email protected]> --- drivers/firmware/arm_scmi/powercap.c | 13 +++++++++---- include/linux/scmi_protocol.h | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c index cfa1dde71ff4..65fac7fc6169 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -18,7 +18,7 @@ #include "notify.h" /* Updated only after ALL the mandatory features for that version are merged */ -#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x20000 +#define SCMI_PROTOCOL_SUPPORTED_VERSION 0x30000 #define CPL0 0 @@ -156,7 +156,8 @@ struct scmi_powercap_cap_changed_notify_payld { __le32 agent_id; __le32 domain_id; __le32 power_cap; - __le32 pai; + __le32 avg_ivl; + __le32 cpli; }; struct scmi_powercap_meas_changed_notify_payld { @@ -1326,14 +1327,18 @@ scmi_powercap_fill_custom_report(const struct scmi_protocol_handle *ph, const struct scmi_powercap_cap_changed_notify_payld *p = payld; struct scmi_powercap_cap_changed_report *r = report; - if (sizeof(*p) != payld_sz) + if (sizeof(*p) > payld_sz) break; r->timestamp = timestamp; r->agent_id = le32_to_cpu(p->agent_id); r->domain_id = le32_to_cpu(p->domain_id); r->power_cap = le32_to_cpu(p->power_cap); - r->pai = le32_to_cpu(p->pai); + r->avg_ivl = le32_to_cpu(p->avg_ivl); + if (sizeof(*p) == payld_sz) + r->cpli = le32_to_cpu(p->cpli); + else + r->cpli = 0; *src_id = r->domain_id; rep = r; break; diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 8b539bfcf482..ce00106d2b65 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -1129,7 +1129,8 @@ struct scmi_powercap_cap_changed_report { unsigned int agent_id; unsigned int domain_id; unsigned int power_cap; - unsigned int pai; + unsigned int avg_ivl; + unsigned int cpli; }; struct scmi_powercap_meas_changed_report { -- 2.25.1