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>
This commit is contained in:
committed by
Sudeep Holla
parent
908a4f778d
commit
48dc16e2e5
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* System Control and Management Interface (SCMI) System Power Protocol
|
||||
*
|
||||
* Copyright (C) 2020 ARM Ltd.
|
||||
* Copyright (C) 2020-2021 ARM Ltd.
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "SCMI Notifications SYSTEM - " fmt
|
||||
@ -128,4 +128,10 @@ static int scmi_system_protocol_init(struct scmi_handle *handle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(SCMI_PROTOCOL_SYSTEM, system)
|
||||
static const struct scmi_protocol scmi_system = {
|
||||
.id = SCMI_PROTOCOL_SYSTEM,
|
||||
.init = &scmi_system_protocol_init,
|
||||
.ops = NULL,
|
||||
};
|
||||
|
||||
DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(system, scmi_system)
|
||||
|
Reference in New Issue
Block a user