aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Vizzarro <Luca.Vizzarro@arm.com>2020-10-27 14:56:15 +0000
committerjimqui01 <54316584+jimqui01@users.noreply.github.com>2020-11-13 10:03:34 +0000
commit6738315d415ad8ef02bf1b31cf028866b27bd27b (patch)
treed65338666e4af4952d9572551de4bb55f040cd1c
parent88e35e4f3f74c4f806207fd653ef5729815438d1 (diff)
scmi_power_domain: Fix attributes query notifications flag
As per SCMIv2 specifications section 4.3.2.4, when querying the power domain attributes, the attribute at bit 31 must be set when the queried domain supports notifications. Because DEVICE and DEVICE_DEBUG types of power domain domain support notifications, these must set this bit when their attributes are queried. This commit enforces this behaviour. Change-Id: Ib307e61a86cdf0fcd63a91f982ce5bbcce39d013 Signed-off-by: Luca Vizzarro <Luca.Vizzarro@arm.com>
-rw-r--r--module/scmi_power_domain/include/internal/scmi_power_domain.h1
-rw-r--r--module/scmi_power_domain/src/mod_scmi_power_domain.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/module/scmi_power_domain/include/internal/scmi_power_domain.h b/module/scmi_power_domain/include/internal/scmi_power_domain.h
index 2996004b..cc5e5c0b 100644
--- a/module/scmi_power_domain/include/internal/scmi_power_domain.h
+++ b/module/scmi_power_domain/include/internal/scmi_power_domain.h
@@ -59,6 +59,7 @@ struct scmi_pd_power_domain_attributes_a2p {
uint32_t domain_id;
};
+#define SCMI_PD_POWER_STATE_CHANGE_NOTIFICATIONS (1UL << 31)
#define SCMI_PD_POWER_STATE_SET_ASYNC (1 << 30)
#define SCMI_PD_POWER_STATE_SET_SYNC (1 << 29)
diff --git a/module/scmi_power_domain/src/mod_scmi_power_domain.c b/module/scmi_power_domain/src/mod_scmi_power_domain.c
index ab271d33..d853099b 100644
--- a/module/scmi_power_domain/src/mod_scmi_power_domain.c
+++ b/module/scmi_power_domain/src/mod_scmi_power_domain.c
@@ -368,8 +368,14 @@ static int scmi_pd_power_domain_attributes_handler(fwk_id_t service_id,
case MOD_PD_TYPE_DEVICE:
/*
* Support only synchronous POWER_STATE_SET for devices for any agent.
+ * Notifications are also supported for this power domain type.
*/
+#ifdef BUILD_HAS_SCMI_NOTIFICATIONS
+ return_values.attributes = SCMI_PD_POWER_STATE_SET_SYNC |
+ SCMI_PD_POWER_STATE_CHANGE_NOTIFICATIONS;
+#else
return_values.attributes = SCMI_PD_POWER_STATE_SET_SYNC;
+#endif
break;
case MOD_PD_TYPE_SYSTEM: