]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: SOF: sof-client: Add sof_client_ipc4_find_swidget_by_id()
authorJyri Sarha <jyri.sarha@linux.intel.com>
Fri, 29 Aug 2025 09:30:20 +0000 (12:30 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 29 Aug 2025 11:34:17 +0000 (13:34 +0200)
Add sof_client_ipc4_find_swidget_by_id() for finding widgets from SOF
client devices. The motivation is to decode probes debugfs output to
be more readable.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Message-ID: <20250829093022.32094-4-peter.ujfalusi@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-client.c
sound/soc/sof/sof-client.h

index 4c7951338c66f6bd6613de627a40cc725b5520d8..4d0acb8f85cde6b04ae5d2d6d5ed407cfbeb4139 100644 (file)
@@ -353,6 +353,19 @@ struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c,
        return NULL;
 }
 EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_module, "SND_SOC_SOF_CLIENT");
+
+struct snd_sof_widget *sof_client_ipc4_find_swidget_by_id(struct sof_client_dev *cdev,
+                                                         u32 module_id, int instance_id)
+{
+       struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
+
+       if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4)
+               return sof_ipc4_find_swidget_by_ids(sdev, module_id, instance_id);
+       dev_err(sdev->dev, "Only supported with IPC4\n");
+
+       return NULL;
+}
+EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_swidget_by_id, "SND_SOC_SOF_CLIENT");
 #endif
 
 int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state)
index b6ccc2cd69e52c81c65d8b83f8e98d8f90205b23..c3741b92a26f0c9453c23ef2b19adaab552334d2 100644 (file)
@@ -47,6 +47,8 @@ int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
                                bool set);
 
 struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, const guid_t *u);
+struct snd_sof_widget *sof_client_ipc4_find_swidget_by_id(struct sof_client_dev *cdev,
+                                                         u32 module_id, int instance_id);
 
 struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
 struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);