From 39adb102890e99a485707d588fadcb142335fe87 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 23 Aug 2024 15:04:06 +0200 Subject: [PATCH] asoc: sof: add a hard-coded array of loadable extensions The driver currently loads drivers that are missing in the firmware base image but are present in the topology. It might also be necessary to load auxiliary loadable objects. Use a hard-coded array for that. Signed-off-by: Guennadi Liakhovetski --- sound/soc/sof/topology.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index b5438213199163..008907474ce2ae 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2164,6 +2164,14 @@ static int sof_set_widget_pipeline(struct snd_sof_dev *sdev, struct snd_sof_pipe return 0; } +#ifdef CONFIG_SND_SOC_SOF_IPC4 +#include + +static const guid_t preload_uuid[] = { + GUID_INIT(0x93446E12, 0x1864, 0x4E04, 0xAF, 0xE0, 0x3B, 0x1D, 0x77, 0x8F, 0xFB, 0x79), +}; +#endif + /* completion - called at completion of firmware loading */ static int sof_complete(struct snd_soc_component *scomp) { @@ -2172,6 +2180,7 @@ static int sof_complete(struct snd_soc_component *scomp) const struct sof_ipc_tplg_widget_ops *widget_ops; struct snd_sof_control *scontrol; struct snd_sof_pipeline *spipe; + unsigned int i; int ret; widget_ops = tplg_ops ? tplg_ops->widget : NULL; @@ -2187,6 +2196,13 @@ static int sof_complete(struct snd_soc_component *scomp) } } +#ifdef CONFIG_SND_SOC_SOF_IPC4 + /* Pre-load libraries */ + for (i = 0; i < ARRAY_SIZE(preload_uuid); i++) + if (!sof_ipc4_find_module_by_uuid(sdev, preload_uuid + i)) + return -ENODEV; +#endif + /* set up the IPC structures for the pipeline widgets */ list_for_each_entry(spipe, &sdev->pipeline_list, list) { struct snd_sof_widget *pipe_widget = spipe->pipe_widget;