Skip to content

Commit d4cc891

Browse files
cris-masudeep-holla
authored andcommitted
firmware: arm_scmi: Add module aliases to i.MX vendor protocols
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>
1 parent 54cf6e7 commit d4cc891

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

drivers/firmware/arm_scmi/vendors/imx/imx-sm-bbm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,11 @@ static const struct scmi_protocol scmi_imx_bbm = {
374374
.ops = &scmi_imx_bbm_proto_ops,
375375
.events = &scmi_imx_bbm_protocol_events,
376376
.supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
377-
.vendor_id = "NXP",
378-
.sub_vendor_id = "IMX",
377+
.vendor_id = SCMI_IMX_VENDOR,
378+
.sub_vendor_id = SCMI_IMX_SUBVENDOR,
379379
};
380380
module_scmi_protocol(scmi_imx_bbm);
381381

382+
MODULE_ALIAS("scmi-protocol-" __stringify(SCMI_PROTOCOL_IMX_BBM) "-" SCMI_IMX_VENDOR);
382383
MODULE_DESCRIPTION("i.MX SCMI BBM driver");
383384
MODULE_LICENSE("GPL");

drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,11 @@ static const struct scmi_protocol scmi_imx_misc = {
309309
.ops = &scmi_imx_misc_proto_ops,
310310
.events = &scmi_imx_misc_protocol_events,
311311
.supported_version = SCMI_PROTOCOL_SUPPORTED_VERSION,
312-
.vendor_id = "NXP",
313-
.sub_vendor_id = "IMX",
312+
.vendor_id = SCMI_IMX_VENDOR,
313+
.sub_vendor_id = SCMI_IMX_SUBVENDOR,
314314
};
315315
module_scmi_protocol(scmi_imx_misc);
316316

317+
MODULE_ALIAS("scmi-protocol-" __stringify(SCMI_PROTOCOL_IMX_MISC) "-" SCMI_IMX_VENDOR);
317318
MODULE_DESCRIPTION("i.MX SCMI MISC driver");
318319
MODULE_LICENSE("GPL");

include/linux/scmi_imx_protocol.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#include <linux/notifier.h>
1414
#include <linux/types.h>
1515

16-
enum scmi_nxp_protocol {
17-
SCMI_PROTOCOL_IMX_BBM = 0x81,
18-
SCMI_PROTOCOL_IMX_MISC = 0x84,
19-
};
16+
#define SCMI_PROTOCOL_IMX_BBM 0x81
17+
#define SCMI_PROTOCOL_IMX_MISC 0x84
18+
19+
#define SCMI_IMX_VENDOR "NXP"
20+
#define SCMI_IMX_SUBVENDOR "IMX"
2021

2122
struct scmi_imx_bbm_proto_ops {
2223
int (*rtc_time_set)(const struct scmi_protocol_handle *ph, u32 id,

0 commit comments

Comments
 (0)