aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware/arm_scmi/power.c
diff options
context:
space:
mode:
authorCristian Marussi2021-03-16 12:48:26 +0000
committerSudeep Holla2021-03-29 09:40:47 +0100
commit48dc16e2e52ca386d97435f257ef8a754becb0b8 (patch)
tree2109a6f4be42bba8bb25e2b14cc752e58cb88390 /drivers/firmware/arm_scmi/power.c
parent908a4f778dc7cc0087a862bf43c8bba8821b610c (diff)
firmware: arm_scmi: Extend protocol registration interfaces
Extend common protocol registration routines and provide some new generic protocols get/put helpers that can track protocols usage and automatically perform the proper initialization and de-initialization on demand when required. Convert all standard protocols to use this new registration scheme while keeping them all still using the usual initialization logic bound to SCMI devices probing. Link: https://lore.kernel.org/r/20210316124903.35011-2-cristian.marussi@arm.com Tested-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware/arm_scmi/power.c')
-rw-r--r--drivers/firmware/arm_scmi/power.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/firmware/arm_scmi/power.c b/drivers/firmware/arm_scmi/power.c
index 1f37258e9bee..a5e5e22913b5 100644
--- a/drivers/firmware/arm_scmi/power.c
+++ b/drivers/firmware/arm_scmi/power.c
@@ -2,7 +2,7 @@
/*
* System Control and Management Interface (SCMI) Power Protocol
*
- * Copyright (C) 2018 ARM Ltd.
+ * Copyright (C) 2018-2021 ARM Ltd.
*/
#define pr_fmt(fmt) "SCMI Notifications POWER - " fmt
@@ -301,4 +301,10 @@ static int scmi_power_protocol_init(struct scmi_handle *handle)
return 0;
}
-DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(SCMI_PROTOCOL_POWER, power)
+static const struct scmi_protocol scmi_power = {
+ .id = SCMI_PROTOCOL_POWER,
+ .init = &scmi_power_protocol_init,
+ .ops = &power_ops,
+};
+
+DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(power, scmi_power)