linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter
@ 2025-05-06 11:33 Bard Liao
  2025-05-06 11:33 ` [PATCH 1/3] ASoC: SOF: add disable_function_topology flag Bard Liao
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bard Liao @ 2025-05-06 11:33 UTC (permalink / raw)
  To: broonie, tiwai; +Cc: linux-sound, pierre-louis.bossart, bard.liao

SOF will load the function topologies by default. However, user may want
to use the monolithic topology. Add a flag amd a module parameter to
allow user specify the topology or not using function topologies.

Bard Liao (3):
  ASoC: SOF: add disable_function_topology flag
  ASoC: SOF: set disable_function_topology if override_tplg_filename is
    set
  ASoC: SOF: add disable_function_topology module parameter

 include/sound/sof.h      |  1 +
 sound/soc/sof/core.c     | 10 +++++++---
 sound/soc/sof/topology.c |  7 ++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ASoC: SOF: add disable_function_topology flag
  2025-05-06 11:33 [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter Bard Liao
@ 2025-05-06 11:33 ` Bard Liao
  2025-05-06 11:33 ` [PATCH 2/3] ASoC: SOF: set disable_function_topology if override_tplg_filename is set Bard Liao
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Bard Liao @ 2025-05-06 11:33 UTC (permalink / raw)
  To: broonie, tiwai; +Cc: linux-sound, pierre-louis.bossart, bard.liao

SOF driver will load required function topologies dynamically. However,
we prefer using the monolithic topology. Add a flag to allow user not
using the function topologies.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 include/sound/sof.h      | 1 +
 sound/soc/sof/topology.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/sound/sof.h b/include/sound/sof.h
index 64fd5504cb2b..eddea82c7b5a 100644
--- a/include/sound/sof.h
+++ b/include/sound/sof.h
@@ -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;
 
 	/* loadable external libraries available under this directory */
 	const char *fw_lib_prefix;
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 5d3ee3a86392..fd80451cb4c0 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2481,7 +2481,8 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
 	if (!tplg_files)
 		return -ENOMEM;
 
-	if (sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
+	if (!sof_pdata->disable_function_topology && sof_pdata->machine &&
+	    sof_pdata->machine->get_function_tplg_files) {
 		tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
 								       sof_pdata->machine,
 								       tplg_filename_prefix,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ASoC: SOF: set disable_function_topology if override_tplg_filename is set
  2025-05-06 11:33 [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter Bard Liao
  2025-05-06 11:33 ` [PATCH 1/3] ASoC: SOF: add disable_function_topology flag Bard Liao
@ 2025-05-06 11:33 ` Bard Liao
  2025-05-06 11:33 ` [PATCH 3/3] ASoC: SOF: add disable_function_topology module parameter Bard Liao
  2025-05-07 11:13 ` [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Bard Liao @ 2025-05-06 11:33 UTC (permalink / raw)
  To: broonie, tiwai; +Cc: linux-sound, pierre-louis.bossart, bard.liao

User will expect the specified topology is used when
override_tplg_filename is set. However, the using function topologies
feature may use the function topologies instead of the specified
topology.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/core.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index aed834d03e10..b11f408f1366 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -607,7 +607,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;
@@ -619,8 +620,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)
@@ -654,7 +658,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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ASoC: SOF: add disable_function_topology module parameter
  2025-05-06 11:33 [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter Bard Liao
  2025-05-06 11:33 ` [PATCH 1/3] ASoC: SOF: add disable_function_topology flag Bard Liao
  2025-05-06 11:33 ` [PATCH 2/3] ASoC: SOF: set disable_function_topology if override_tplg_filename is set Bard Liao
@ 2025-05-06 11:33 ` Bard Liao
  2025-05-07 11:13 ` [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Bard Liao @ 2025-05-06 11:33 UTC (permalink / raw)
  To: broonie, tiwai; +Cc: linux-sound, pierre-louis.bossart, bard.liao

User can disable the loading function topology feature.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/topology.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index fd80451cb4c0..2d4e660b19d5 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -19,6 +19,10 @@
 #include "sof-audio.h"
 #include "ops.h"
 
+static bool disable_function_topology;
+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
@@ -2481,8 +2485,8 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
 	if (!tplg_files)
 		return -ENOMEM;
 
-	if (!sof_pdata->disable_function_topology && sof_pdata->machine &&
-	    sof_pdata->machine->get_function_tplg_files) {
+	if (!sof_pdata->disable_function_topology && !disable_function_topology &&
+	    sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
 		tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
 								       sof_pdata->machine,
 								       tplg_filename_prefix,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter
  2025-05-06 11:33 [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter Bard Liao
                   ` (2 preceding siblings ...)
  2025-05-06 11:33 ` [PATCH 3/3] ASoC: SOF: add disable_function_topology module parameter Bard Liao
@ 2025-05-07 11:13 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2025-05-07 11:13 UTC (permalink / raw)
  To: tiwai, Bard Liao; +Cc: linux-sound, pierre-louis.bossart, bard.liao

On Tue, 06 May 2025 19:33:07 +0800, Bard Liao wrote:
> SOF will load the function topologies by default. However, user may want
> to use the monolithic topology. Add a flag amd a module parameter to
> allow user specify the topology or not using function topologies.
> 
> Bard Liao (3):
>   ASoC: SOF: add disable_function_topology flag
>   ASoC: SOF: set disable_function_topology if override_tplg_filename is
>     set
>   ASoC: SOF: add disable_function_topology module parameter
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: SOF: add disable_function_topology flag
      commit: e48a906af6b3cfd09c50af14a8ea7a5cf45b39ab
[2/3] ASoC: SOF: set disable_function_topology if override_tplg_filename is set
      commit: 92b5f92d1128e108c583d63fab114601ce04eced
[3/3] ASoC: SOF: add disable_function_topology module parameter
      commit: 7b400c9ab879a86aa4b9bf5d9fdd3df558eed9b5

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-07 11:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 11:33 [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and module parameter Bard Liao
2025-05-06 11:33 ` [PATCH 1/3] ASoC: SOF: add disable_function_topology flag Bard Liao
2025-05-06 11:33 ` [PATCH 2/3] ASoC: SOF: set disable_function_topology if override_tplg_filename is set Bard Liao
2025-05-06 11:33 ` [PATCH 3/3] ASoC: SOF: add disable_function_topology module parameter Bard Liao
2025-05-07 11:13 ` [PATCH 0/3] ASoC: SOF: add disable_function_topology flag and " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).