[PATCH 8/8] firmware: arm_scmi: Initialise all protocol devices and transport channels

Sudeep Holla
2025-10-17T13:24:18Z

Unlike Device Tree, the ACPI SCMI namespace device does not provide child
fwnodes to represent each protocol. To initialise all protocol devices and
their associated transport channels, we must iterate over the supported DSD
entries defined in the device.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/firmware/arm_scmi/driver.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index f679a769fc87..9470be5de692 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -2786,7 +2786,7 @@ scmi_txrx_setup(struct scmi_info *info, struct fwnode_handle *fwnode,
*/
static int scmi_channels_setup(struct scmi_info *info)
{
- int ret;
+ int ret, idx;
struct fwnode_handle *fwnode = dev_fwnode(info->dev);

/* Initialize a common generic channel at first */
@@ -2809,6 +2809,17 @@ static int scmi_channels_setup(struct scmi_info *info)
return ret;
}

+ if (acpi_disabled)
+ return 0;
+
+ for (idx = 1; idx < ARRAY_SIZE(scmi_dsd_info_list); idx++) {
+ int prot_id = scmi_dsd_info_list[idx].protocol_id;
+
+ ret = scmi_txrx_setup(info, fwnode, prot_id);
+ if (ret)
+ return ret;
+ }
+
return 0;
}

@@ -3175,7 +3186,7 @@ static void scmi_device_check_create(struct fwnode_handle *fwnode, int prot_id,

static int scmi_probe(struct platform_device *pdev)
{
- int ret;
+ int ret, idx;
char *err_str = "probe failure\n";
struct scmi_handle *handle;
const struct scmi_desc *desc;
@@ -3304,6 +3315,15 @@ static int scmi_probe(struct platform_device *pdev)
scmi_device_check_create(child, prot_id, info);
}

+ if (acpi_disabled)
+ return 0;
+
+ for (idx = 1; idx < ARRAY_SIZE(scmi_dsd_info_list); idx++) {
+ int prot_id = scmi_dsd_info_list[idx].protocol_id;
+
+ scmi_device_check_create(dev_fwnode(dev), prot_id, info);
+ }
+
return 0;

notification_exit:

--
2.34.1