Skip to content

Commit 7b0b5e7

Browse files
author
Jyri Sarha
committed
ASoC: SOF: client: Add sof_client_ipc4_find_swidget_by_id()
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 <[email protected]>
1 parent ed3240c commit 7b0b5e7

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

sound/soc/sof/sof-client.c

+13
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,19 @@ struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c,
353353
return NULL;
354354
}
355355
EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_module, "SND_SOC_SOF_CLIENT");
356+
357+
struct snd_sof_widget *sof_client_ipc4_find_swidget_by_id(struct sof_client_dev *cdev,
358+
u32 module_id, int instance_id)
359+
{
360+
struct snd_sof_dev *sdev = sof_client_dev_to_sof_dev(cdev);
361+
362+
if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4)
363+
return sof_ipc4_find_swidget_by_ids(sdev, module_id, instance_id);
364+
dev_err(sdev->dev, "Only supported with IPC4\n");
365+
366+
return NULL;
367+
}
368+
EXPORT_SYMBOL_NS_GPL(sof_client_ipc4_find_swidget_by_id, "SND_SOC_SOF_CLIENT");
356369
#endif
357370

358371
int sof_suspend_clients(struct snd_sof_dev *sdev, pm_message_t state)

sound/soc/sof/sof-client.h

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
4747
bool set);
4848

4949
struct sof_ipc4_fw_module *sof_client_ipc4_find_module(struct sof_client_dev *c, const guid_t *u);
50+
struct snd_sof_widget *sof_client_ipc4_find_swidget_by_id(struct sof_client_dev *cdev,
51+
u32 module_id, int instance_id);
5052

5153
struct dentry *sof_client_get_debugfs_root(struct sof_client_dev *cdev);
5254
struct device *sof_client_get_dma_dev(struct sof_client_dev *cdev);

0 commit comments

Comments
 (0)