Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sound/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ struct snd_sof_pdata {
const char *fw_filename;
const char *tplg_filename_prefix;
const char *tplg_filename;
bool disable_function_topology;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao can you modify the commit message to say "Add a kernel module parameter to override loading function topologies when set"?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao can you modify the commit message to say "Add a kernel module parameter to override loading function topologies when set"?

@ranj063 But the disable_function_topology module parameter doesn't use this flag. From @ujfalusi's point of view, the disable_function_topology flag and the disable_function_topology module parameter are 2 different parameters.
#5373 (comment)

Do you prefer we set the disable_function_topology flag if the disable_function_topology module parameter is set?
I am all ears.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see. Sorry i got confused there.


/* loadable external libraries available under this directory */
const char *fw_lib_prefix;
Expand Down
10 changes: 7 additions & 3 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ static void sof_probe_work(struct work_struct *work)
}

static void
sof_apply_profile_override(struct sof_loadable_file_profile *path_override)
sof_apply_profile_override(struct sof_loadable_file_profile *path_override,
struct snd_sof_pdata *plat_data)
{
if (override_ipc_type >= 0 && override_ipc_type < SOF_IPC_TYPE_COUNT)
path_override->ipc_type = override_ipc_type;
Expand All @@ -636,8 +637,11 @@ sof_apply_profile_override(struct sof_loadable_file_profile *path_override)
path_override->fw_lib_path = override_lib_path;
if (override_tplg_path)
path_override->tplg_path = override_tplg_path;
if (override_tplg_filename)
if (override_tplg_filename) {
path_override->tplg_name = override_tplg_filename;
/* User requested a specific topology file and expect it to be loaded */
plat_data->disable_function_topology = true;
}
}

int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
Expand Down Expand Up @@ -668,7 +672,7 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
}
}

sof_apply_profile_override(&plat_data->ipc_file_profile_base);
sof_apply_profile_override(&plat_data->ipc_file_profile_base, plat_data);

/* Initialize sof_ops based on the initial selected IPC version */
ret = sof_init_sof_ops(sdev);
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "sof-audio.h"
#include "ops.h"

static bool disable_function_topology = false;
module_param(disable_function_topology, bool, 0444);
MODULE_PARM_DESC(disable_function_topology, "Disable function topology loading");

#define COMP_ID_UNASSIGNED 0xffffffff
/*
* Constants used in the computation of linear volume gain
Expand Down Expand Up @@ -2502,7 +2506,8 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
if (!tplg_files)
return -ENOMEM;

if (sof_pdata->machine->get_function_tplg_files) {
if (!sof_pdata->disable_function_topology && !disable_function_topology &&
sof_pdata->machine->get_function_tplg_files) {
tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
sof_pdata->machine,
tplg_filename_prefix,
Expand Down
Loading