@@ -2952,7 +2952,7 @@ static int scmi_debugfs_raw_mode_setup(struct scmi_info *info)
static int scmi_probe(struct platform_device *pdev)
{
- int ret;
+ int i, ret;
char *err_str = "probe failure\n";
struct scmi_handle *handle;
const struct scmi_desc *desc;
@@ -2960,6 +2960,7 @@ static int scmi_probe(struct platform_device *pdev)
bool coex = IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX);
struct device *dev = &pdev->dev;
struct device_node *child, *np = dev->of_node;
+ uint32_t protocols[] = { SCMI_PROTOCOL_SYSTEM, SCMI_PROTOCOL_POWERCAP };
desc = of_device_get_match_data(dev);
if (!desc)
@@ -3114,6 +3115,36 @@ static int scmi_probe(struct platform_device *pdev)
scmi_create_protocol_devices(child, info, prot_id, NULL);
}
+ /* Create devices that not have a device node */
+ for (i = 0; i < ARRAY_SIZE(protocols); i++) {
+ void *p;
+ u32 prot_id = protocols[i];
+
+ p = idr_find(&info->active_protocols, prot_id);
+ if (p)
+ continue;
+
+ if (!scmi_is_protocol_implemented(handle, prot_id)) {
+ dev_info(dev, "SCMI protocol 0x%x not implemented\n",
+ protocols[i]);
+ continue;
+ }
+
+ ret = scmi_txrx_setup(info, NULL, prot_id);
+ if (ret) {
+ dev_err(dev, "SCMI protocol 0x%x txrx setup fail(%d)\n",
+ prot_id, ret);
+ continue;
+ }
+
+ ret = idr_alloc(&info->active_protocols, NULL,
+ prot_id, prot_id + 1, GFP_KERNEL);
+ if (ret != prot_id)
+ continue;
+
+ scmi_create_protocol_devices(NULL, info, prot_id, NULL);
+ }
+
return 0;
notification_exit: