From 99c159279c6dfa2c4867c7f76875f58263f8f43b Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Thu, 9 Oct 2025 17:40:21 +0800 Subject: [PATCH] ASoC: SOF: don't check the existence of dummy topology MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Monolithic topology is not needed if function topology is used. Instead of creating a dummy topology in the file system, we can skip the existence check in the kernel. Signed-off-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Simon Trimmer Link: https://patch.msgid.link/20251009094023.3474895-8-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sof/fw-file-profile.c | 4 ++++ sound/soc/sof/topology.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c index d2b2328600913..4a2afc04f3380 100644 --- a/sound/soc/sof/fw-file-profile.c +++ b/sound/soc/sof/fw-file-profile.c @@ -73,6 +73,10 @@ static int sof_test_topology_file(struct device *dev, if (!profile->tplg_path || !profile->tplg_name) return 0; + /* Dummy topology does not exist and should not be used */ + if (strstr(profile->tplg_name, "dummy")) + return 0; + tplg_filename = kasprintf(GFP_KERNEL, "%s/%s", profile->tplg_path, profile->tplg_name); if (!tplg_filename) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 3404f1306494c..c1083ea4624ad 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -2523,6 +2523,11 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file) * callback or the callback returns 0. */ if (!tplg_cnt) { + if (strstr(file, "dummy")) { + dev_err(scomp->dev, + "Function topology is required, please upgrade sof-firmware\n"); + return -EINVAL; + } tplg_files[0] = file; tplg_cnt = 1; dev_info(scomp->dev, "loading topology: %s\n", file); -- 2.47.3