From 4c152aa9709e2edd5af091274185245b2228e027 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Mon, 6 Mar 2023 15:07:53 +0200 Subject: [PATCH 1/2] topology2: mixer: Add no_wname_in_kcontrol_name attribute to comp tokens Adds "no_wname_in_kcontrol_name" token, and the associated boolean attribute to generic component attributes. If the attribute is set to true for a widget then non of its associated kcontrols names will have the widget name as a prefix. For example "gain.2.1 Post Mixer Analog Playback Volume" becomes just "Post Mixer Analog Playback Volume". Signed-off-by: Jyri Sarha --- tools/topology/topology2/include/common/tokens.conf | 1 + .../topology2/include/components/widget-common.conf | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index 3277c7cb0497..456406009b7f 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -24,6 +24,7 @@ Object.Base.VendorToken { output_pin_binding_name 414 num_input_audio_formats 415 num_output_audio_formats 416 + no_wname_in_kcontrol_name 417 } "2" { diff --git a/tools/topology/topology2/include/components/widget-common.conf b/tools/topology/topology2/include/components/widget-common.conf index 07705ad23317..2783c8a4d103 100644 --- a/tools/topology/topology2/include/components/widget-common.conf +++ b/tools/topology/topology2/include/components/widget-common.conf @@ -104,3 +104,15 @@ DefineAttribute.uuid { # Token set reference name and type token_ref "comp.uuid" } + +DefineAttribute."no_wname_in_kcontrol_name" { + type "string" + # Token set reference name + token_ref "comp.bool" + constraints { + !valid_values [ + "true" + "false" + ] + } +} From aee77aad5d80095f73d339956ae7f146c5063886 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Wed, 28 Jun 2023 17:19:53 +0300 Subject: [PATCH 2/2] topology2: widget-common.conf: Default no_wname_in_kcontrol_name to true Set no_wname_in_kcontrol_name attribute default to true to for all widgets. This change will drop widget name prefixes from all kcontrols created from currently defined widgets, as they all include widget-common.conf. In practice this means that for example "gain.2.1 Post Mixer Analog Playback Volume" becomes just "Post Mixer Analog Playback Volume" and same for all kcontrols. This behavior can be reverted per widget basis by setting no_wname_in_kcontrol_name attribute to false in the relevant widget. Signed-off-by: Jyri Sarha --- tools/topology/topology2/include/components/widget-common.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/topology/topology2/include/components/widget-common.conf b/tools/topology/topology2/include/components/widget-common.conf index 2783c8a4d103..af87e4e70f7d 100644 --- a/tools/topology/topology2/include/components/widget-common.conf +++ b/tools/topology/topology2/include/components/widget-common.conf @@ -116,3 +116,5 @@ DefineAttribute."no_wname_in_kcontrol_name" { ] } } + +no_wname_in_kcontrol_name "true"