Skip to content

Commit

Permalink
asoc: sof: add a hard-coded array of loadable extensions
Browse files Browse the repository at this point in the history
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 <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Aug 23, 2024
1 parent 82543d8 commit ad0809f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "ipc4-priv.h"

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)
{
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit ad0809f

Please sign in to comment.