summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2024-02-12 15:32:27 +0300
committerSudeep Holla <sudeep.holla@arm.com>2024-02-20 09:35:55 +0300
commit9f5ddbc22225565df5fa1b918a02f4e9e5f7bf0a (patch)
tree4f9b0ce5575a20df171538c6d593624cf9012faf
parentb7e400bc2e2dd9adf5996f8a496d3badb3ecb09e (diff)
downloadlinux-9f5ddbc22225565df5fa1b918a02f4e9e5f7bf0a.tar.xz
firmware: arm_scmi: Implement is_notify_supported callback in system power protocol
Add a preliminary check to verify if the system power protocol related notify enable commands are supported at all by the SCMI platform, and then provide the callback needed to allow the core SCMI notification subsytem to do a fine-grain check if a specific resource domain supports notifications. Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Link: https://lore.kernel.org/r/20240212123233.1230090-6-cristian.marussi@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r--drivers/firmware/arm_scmi/system.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/system.c b/drivers/firmware/arm_scmi/system.c
index 1621da97bcbb..b6358c155f7f 100644
--- a/drivers/firmware/arm_scmi/system.c
+++ b/drivers/firmware/arm_scmi/system.c
@@ -36,8 +36,20 @@ struct scmi_system_power_state_notifier_payld {
struct scmi_system_info {
u32 version;
bool graceful_timeout_supported;
+ bool power_state_notify_cmd;
};
+static bool scmi_system_notify_supported(const struct scmi_protocol_handle *ph,
+ u8 evt_id, u32 src_id)
+{
+ struct scmi_system_info *pinfo = ph->get_priv(ph);
+
+ if (evt_id != SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER)
+ return false;
+
+ return pinfo->power_state_notify_cmd;
+}
+
static int scmi_system_request_notify(const struct scmi_protocol_handle *ph,
bool enable)
{
@@ -114,6 +126,7 @@ static const struct scmi_event system_events[] = {
};
static const struct scmi_event_ops system_event_ops = {
+ .is_notify_supported = scmi_system_notify_supported,
.set_notify_enabled = scmi_system_set_notify_enabled,
.fill_custom_report = scmi_system_fill_custom_report,
};
@@ -147,6 +160,9 @@ static int scmi_system_protocol_init(const struct scmi_protocol_handle *ph)
if (PROTOCOL_REV_MAJOR(pinfo->version) >= 0x2)
pinfo->graceful_timeout_supported = true;
+ if (!ph->hops->protocol_msg_check(ph, SYSTEM_POWER_STATE_NOTIFY, NULL))
+ pinfo->power_state_notify_cmd = true;
+
return ph->set_priv(ph, pinfo, version);
}