FROMLIST: firmware: arm_scmi: add protocol modularization support

Extend SCMI protocols accounting mechanism to address possible module
usage and add the support to possibly define new protocols as loadable
modules.

Keep Standard protocols built into the SCMI core.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I75f2e400c0fe6a0692a1acc2e20f54a3c7336ab7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
This commit is contained in:
Cristian Marussi
2021-02-02 22:15:54 +00:00
committed by Todd Kjos
parent ee250b6df6
commit db15cd2926
11 changed files with 44 additions and 2 deletions

View File

@@ -709,6 +709,18 @@ static inline void scmi_driver_unregister(struct scmi_driver *driver) {}
#define module_scmi_driver(__scmi_driver) \
module_driver(__scmi_driver, scmi_register, scmi_unregister)
/**
* module_scmi_protocol() - Helper macro for registering a scmi protocol
* @__scmi_protocol: scmi_protocol structure
*
* Helper macro for scmi drivers to set up proper module init / exit
* functions. Replaces module_init() and module_exit() and keeps people from
* printing pointless things to the kernel log when their driver is loaded.
*/
#define module_scmi_protocol(__scmi_protocol) \
module_driver(__scmi_protocol, \
scmi_protocol_register, scmi_protocol_unregister)
struct scmi_protocol;
int scmi_protocol_register(const struct scmi_protocol *proto);
void scmi_protocol_unregister(const struct scmi_protocol *proto);