]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_scmi: Add module aliases to i.MX vendor protocols
authorCristian Marussi <cristian.marussi@arm.com>
Mon, 9 Dec 2024 16:49:56 +0000 (16:49 +0000)
committerSudeep Holla <sudeep.holla@arm.com>
Tue, 10 Dec 2024 10:30:45 +0000 (10:30 +0000)
Using the pattern 'scmi-protocol-0x<PROTO_ID>-<VEND_ID>' as MODULE_ALIAS
allows the SCMI core to autoload this protocol, if built as a module, when
its protocol operations are requested by an SCMI driver.

Cc: Peng Fan <peng.fan@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Message-Id: <20241209164957.1801886-3-cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c
drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c
include/linux/scmi_imx_protocol.h

index 17799eacf06c3036033a9673da3c44de40014684..aa176c1a5eefe4220e54e366cf3a267de639fa9b 100644 (file)
@@ -374,10 +374,11 @@ static const struct scmi_protocol scmi_imx_bbm = {
        .ops = &scmi_imx_bbm_proto_ops,
        .events = &scmi_imx_bbm_protocol_events,
        .supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
-       .vendor_id = "NXP",
-       .sub_vendor_id = "IMX",
+       .vendor_id = SCMI_IMX_VENDOR,
+       .sub_vendor_id = SCMI_IMX_SUBVENDOR,
 };
 module_scmi_protocol(scmi_imx_bbm);
 
+MODULE_ALIAS("scmi-protocol-" __stringify(SCMI_PROTOCOL_IMX_BBM) "-" SCMI_IMX_VENDOR);
 MODULE_DESCRIPTION("i.MX SCMI BBM driver");
 MODULE_LICENSE("GPL");
index a86ab9b35953f78a1612bf3166467403b80147d4..83b69fc4fba5b4c8cf578517ffed7a01bfaccf12 100644 (file)
@@ -309,10 +309,11 @@ static const struct scmi_protocol scmi_imx_misc = {
        .ops = &scmi_imx_misc_proto_ops,
        .events = &scmi_imx_misc_protocol_events,
        .supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
-       .vendor_id = "NXP",
-       .sub_vendor_id = "IMX",
+       .vendor_id = SCMI_IMX_VENDOR,
+       .sub_vendor_id = SCMI_IMX_SUBVENDOR,
 };
 module_scmi_protocol(scmi_imx_misc);
 
+MODULE_ALIAS("scmi-protocol-" __stringify(SCMI_PROTOCOL_IMX_MISC) "-" SCMI_IMX_VENDOR);
 MODULE_DESCRIPTION("i.MX SCMI MISC driver");
 MODULE_LICENSE("GPL");
index 066216f1357aac21d00f92ae601d072bfe06193e..53b356a26414279f4aaaa8287c32209ed1ad57b4 100644 (file)
 #include <linux/notifier.h>
 #include <linux/types.h>
 
-enum scmi_nxp_protocol {
-       SCMI_PROTOCOL_IMX_BBM = 0x81,
-       SCMI_PROTOCOL_IMX_MISC = 0x84,
-};
+#define        SCMI_PROTOCOL_IMX_BBM   0x81
+#define        SCMI_PROTOCOL_IMX_MISC  0x84
+
+#define SCMI_IMX_VENDOR                "NXP"
+#define SCMI_IMX_SUBVENDOR     "IMX"
 
 struct scmi_imx_bbm_proto_ops {
        int (*rtc_time_set)(const struct scmi_protocol_handle *ph, u32 id,