Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL
@ 2025-12-15 10:10 Peter Ujfalusi
  2025-12-15 10:10 ` [PATCH for 6.19 1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op Peter Ujfalusi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-12-15 10:10 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart, tiwai

Hi,

support for NVL-S and the support using functional topology fragments for
Soundwire configurations is introduced in 6.19-rc1 in parallel.

The SOF projects plan is to not create individual topology files for NVL
as with SDCA and the functional topology support can handle most if not
all soundwire devices going forward.

However one issue have been identified with the functional topology only
support, which was masked by the presence of a single topology file:
if the device contains a dai link for which we don't have topology fragment,
then the probe will fail.
This worked with a fallback to a monolithic topology file - which made the
dai link to be ignored.

The first patch in the series adds a flag to instruct the function discovery
to make a best effort to form a card by ignoring functions without
corresponding fragment (and print this out for developers) in case there
is no fallback topology available.

The second patch removes the match entry to refer to a topology file which
will not be built by the SOF project.

Mark, I needed to wait for -rc1 tag to send this for 6.19 as the two topic
series arrived via different path and I did not wanted to case hassle to
create immutable branches to handle this.

We have been running these patches in CI for over a month and these are
needed to have the NVL-S audio support in correct shape for 6.19.
We were planning the move away from the monolithic topology files for
Soundwire for quite long and NVL/6.19 would be a great point to finally
do the transition.

Regards,
Peter
---
Peter Ujfalusi (2):
  ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files
    op
  ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match
    table

 include/sound/soc-acpi.h                      |  5 +-
 .../intel/common/soc-acpi-intel-nvl-match.c   | 49 -------------------
 .../intel/common/sof-function-topology-lib.c  |  5 +-
 .../intel/common/sof-function-topology-lib.h  |  2 +-
 sound/soc/sof/topology.c                      | 18 ++++++-
 5 files changed, 26 insertions(+), 53 deletions(-)

-- 
2.52.0


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

* [PATCH for 6.19 1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op
  2025-12-15 10:10 [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Peter Ujfalusi
@ 2025-12-15 10:10 ` Peter Ujfalusi
  2025-12-15 10:10 ` [PATCH for 6.19 2/2] ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match table Peter Ujfalusi
  2025-12-16 21:29 ` [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-12-15 10:10 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart, tiwai

When there is no fallback possibility available for the function topology
use it is better to try to create  a profile for the card in best effort
manner, leaving out non supported links for example.

As an example: some laptops present SSPx-BT link but we don't have fragment
yet to support this. If we only have support for functional topology
without monolithic fallback then we would fail the card creation.
The reason why the monolithic topology works on the same device is that it
does not have the SSPx-BT link handled, it is ignored.

In case when there is no fallback possibility we should try to create the
card with links that we support as best effort instead of failing and
leaving the user without a card.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 include/sound/soc-acpi.h                       |  5 ++++-
 .../intel/common/sof-function-topology-lib.c   |  5 ++++-
 .../intel/common/sof-function-topology-lib.h   |  2 +-
 sound/soc/sof/topology.c                       | 18 +++++++++++++++++-
 4 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h
index 90d73b9bddab..0519afd7217f 100644
--- a/include/sound/soc-acpi.h
+++ b/include/sound/soc-acpi.h
@@ -203,6 +203,8 @@ struct snd_soc_acpi_link_adr {
  *	@mach: the pointer of the machine driver
  *	@prefix: the prefix of the topology file name. Typically, it is the path.
  *	@tplg_files: the pointer of the array of the topology file names.
+ *	@best_effort: ignore non supported links and try to build the card in best effort
+ *		      with supported links
  */
 /* Descriptor for SST ASoC machine driver */
 struct snd_soc_acpi_mach {
@@ -224,7 +226,8 @@ struct snd_soc_acpi_mach {
 	const u32 tplg_quirk_mask;
 	int (*get_function_tplg_files)(struct snd_soc_card *card,
 				       const struct snd_soc_acpi_mach *mach,
-				       const char *prefix, const char ***tplg_files);
+				       const char *prefix, const char ***tplg_files,
+				       bool best_effort);
 };
 
 #define SND_SOC_ACPI_MAX_CODECS 3
diff --git a/sound/soc/intel/common/sof-function-topology-lib.c b/sound/soc/intel/common/sof-function-topology-lib.c
index b10d4794159a..0daa7d83808b 100644
--- a/sound/soc/intel/common/sof-function-topology-lib.c
+++ b/sound/soc/intel/common/sof-function-topology-lib.c
@@ -28,7 +28,7 @@ enum tplg_device_id {
 #define SOF_INTEL_PLATFORM_NAME_MAX 4
 
 int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_mach *mach,
-			   const char *prefix, const char ***tplg_files)
+			   const char *prefix, const char ***tplg_files, bool best_effort)
 {
 	struct snd_soc_acpi_mach_params mach_params = mach->mach_params;
 	struct snd_soc_dai_link *dai_link;
@@ -87,6 +87,9 @@ int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_
 			dev_dbg(card->dev,
 				"dai_link %s is not supported by separated tplg yet\n",
 				dai_link->name);
+			if (best_effort)
+				continue;
+
 			return 0;
 		}
 		if (tplg_mask & BIT(tplg_dev))
diff --git a/sound/soc/intel/common/sof-function-topology-lib.h b/sound/soc/intel/common/sof-function-topology-lib.h
index e7d0c39d0788..f358f8c52d78 100644
--- a/sound/soc/intel/common/sof-function-topology-lib.h
+++ b/sound/soc/intel/common/sof-function-topology-lib.h
@@ -10,6 +10,6 @@
 #define _SND_SOC_ACPI_INTEL_GET_TPLG_H
 
 int sof_sdw_get_tplg_files(struct snd_soc_card *card, const struct snd_soc_acpi_mach *mach,
-			   const char *prefix, const char ***tplg_files);
+			   const char *prefix, const char ***tplg_files, bool best_effort);
 
 #endif
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index c1083ea4624a..c76545e70860 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2506,12 +2506,28 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
 	if (!tplg_files)
 		return -ENOMEM;
 
+	/* Try to use function topologies if possible */
 	if (!sof_pdata->disable_function_topology && !disable_function_topology &&
 	    sof_pdata->machine && sof_pdata->machine->get_function_tplg_files) {
+		/*
+		 * When the topology name contains 'dummy' word, it means that
+		 * there is no fallback option to monolithic topology in case
+		 * any of the function topologies might be missing.
+		 * In this case we should use best effort to form the card,
+		 * ignoring functionalities that we are missing a fragment for.
+		 *
+		 * Note: monolithic topologies also ignore these possibly
+		 * missing functions, so the functionality of the card would be
+		 * identical to the case if there would be a fallback monolithic
+		 * topology created for the configuration.
+		 */
+		bool no_fallback = strstr(file, "dummy");
+
 		tplg_cnt = sof_pdata->machine->get_function_tplg_files(scomp->card,
 								       sof_pdata->machine,
 								       tplg_filename_prefix,
-								       &tplg_files);
+								       &tplg_files,
+								       no_fallback);
 		if (tplg_cnt < 0) {
 			kfree(tplg_files);
 			return tplg_cnt;
-- 
2.52.0


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

* [PATCH for 6.19 2/2] ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match table
  2025-12-15 10:10 [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Peter Ujfalusi
  2025-12-15 10:10 ` [PATCH for 6.19 1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op Peter Ujfalusi
@ 2025-12-15 10:10 ` Peter Ujfalusi
  2025-12-16 21:29 ` [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2025-12-15 10:10 UTC (permalink / raw)
  To: lgirdwood, broonie
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart, tiwai

Revert "ASoC: Intel: soc-acpi-intel-nvl-match: add rt722 l3 support"

NVL should be only using functional topologies for products, no monolithic
topologies are planned to be released.

In parallel a feature has been landed [1] which allows to remove the
entries from the match table for sdca codecs to rely solely on function
fragments.

Link: https://lore.kernel.org/linux-sound/20251014071335.3844631-1-yung-chuan.liao@linux.intel.com/
This reverts commit 41566e3de40616375e8dfe5455344558b79f9354.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 .../intel/common/soc-acpi-intel-nvl-match.c   | 49 -------------------
 1 file changed, 49 deletions(-)

diff --git a/sound/soc/intel/common/soc-acpi-intel-nvl-match.c b/sound/soc/intel/common/soc-acpi-intel-nvl-match.c
index 2768dd10aaa0..b8695d47e55b 100644
--- a/sound/soc/intel/common/soc-acpi-intel-nvl-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-nvl-match.c
@@ -15,49 +15,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_machines[] = {
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_machines);
 
-/*
- * Multi-function codecs with three endpoints created for
- * headset, amp and dmic functions.
- */
-static const struct snd_soc_acpi_endpoint rt_mf_endpoints[] = {
-	{
-		.num = 0,
-		.aggregated = 0,
-		.group_position = 0,
-		.group_id = 0,
-	},
-	{
-		.num = 1,
-		.aggregated = 0,
-		.group_position = 0,
-		.group_id = 0,
-	},
-	{
-		.num = 2,
-		.aggregated = 0,
-		.group_position = 0,
-		.group_id = 0,
-	},
-};
-
-static const struct snd_soc_acpi_adr_device rt722_3_single_adr[] = {
-	{
-		.adr = 0x000330025d072201ull,
-		.num_endpoints = ARRAY_SIZE(rt_mf_endpoints),
-		.endpoints = rt_mf_endpoints,
-		.name_prefix = "rt722"
-	}
-};
-
-static const struct snd_soc_acpi_link_adr nvl_rt722_l3[] = {
-	{
-		.mask = BIT(3),
-		.num_adr = ARRAY_SIZE(rt722_3_single_adr),
-		.adr_d = rt722_3_single_adr,
-	},
-	{}
-};
-
 /* this table is used when there is no I2S codec present */
 struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_sdw_machines[] = {
 	/* mockup tests need to be first */
@@ -79,12 +36,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_nvl_sdw_machines[] = {
 		.drv_name = "sof_sdw",
 		.sof_tplg_filename = "sof-nvl-rt715-rt711-rt1308-mono.tplg",
 	},
-	{
-		.link_mask = BIT(3),
-		.links = nvl_rt722_l3,
-		.drv_name = "sof_sdw",
-		.sof_tplg_filename = "sof-nvl-rt722.tplg",
-	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_nvl_sdw_machines);
-- 
2.52.0


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

* Re: [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL
  2025-12-15 10:10 [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Peter Ujfalusi
  2025-12-15 10:10 ` [PATCH for 6.19 1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op Peter Ujfalusi
  2025-12-15 10:10 ` [PATCH for 6.19 2/2] ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match table Peter Ujfalusi
@ 2025-12-16 21:29 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2025-12-16 21:29 UTC (permalink / raw)
  To: lgirdwood, Peter Ujfalusi
  Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
	pierre-louis.bossart, tiwai

On Mon, 15 Dec 2025 12:10:34 +0200, Peter Ujfalusi wrote:
> support for NVL-S and the support using functional topology fragments for
> Soundwire configurations is introduced in 6.19-rc1 in parallel.
> 
> The SOF projects plan is to not create individual topology files for NVL
> as with SDCA and the functional topology support can handle most if not
> all soundwire devices going forward.
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op
      commit: c8f3c9fa75ff3822b56b47d5cfa0aaa484040ea8
[2/2] ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match table
      commit: 91b7f7d0eedaaa8993e662c4c6db9b3cfe8a2faf

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] 4+ messages in thread

end of thread, other threads:[~2025-12-16 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15 10:10 [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Peter Ujfalusi
2025-12-15 10:10 ` [PATCH for 6.19 1/2] ASoC: soc-acpi / SOF: Add best_effort flag to get_function_tplg_files op Peter Ujfalusi
2025-12-15 10:10 ` [PATCH for 6.19 2/2] ASoC: Intel: soc-acpi-intel-nvl-match: Drop rt722 l3 from the match table Peter Ujfalusi
2025-12-16 21:29 ` [PATCH for 6.19 0/2] ASoC: Intel: common / SOF: Use function topologies for NVL Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox