summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJyri Sarha <jyri.sarha@intel.com>2023-08-14 18:23:24 -0500
committerMark Brown <broonie@kernel.org>2023-08-15 13:25:55 +0100
commitf7f4a5ad8e11de4edb7b62d099f0501c8610c92b (patch)
tree9152e8dfc4e35d102d6dfcc733c1ea4f5b23a764 /sound
parent56f6ee6d5373406df9f60a870f470ab4b3e6d967 (diff)
downloadlinux-stable-f7f4a5ad8e11de4edb7b62d099f0501c8610c92b.tar.gz
linux-stable-f7f4a5ad8e11de4edb7b62d099f0501c8610c92b.tar.bz2
linux-stable-f7f4a5ad8e11de4edb7b62d099f0501c8610c92b.zip
ASoC: dapm: Add a flag for not having widget name in kcontrol name
The existing soc-dapm code may add a prefix to control names, which in some cases is useful but in others leads to long and confusing kcontrol names such as "gain 2.1 Main Playback Volume". This patch suggests an added flag to prevent the widget name prefix from being added. That flag will be set in the topology file on a per-widget basis. The flag no_wname_in_kcontrol_name is added to struct snd_soc_dapm_widget, and the logic in dapm_create_or_share_kcontrol() is changed to not to add widget name if the flag is set. Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Jyri Sarha <jyri.sarha@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230814232325.86397-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3091e8160bad..f07e83678373 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -916,6 +916,8 @@ static int dapm_create_or_share_kcontrol(struct snd_soc_dapm_widget *w,
return -EINVAL;
}
}
+ if (w->no_wname_in_kcontrol_name)
+ wname_in_long_name = false;
if (wname_in_long_name && kcname_in_long_name) {
/*