From 36edc1275294258566a885b8a5b6c9b3280a0a96 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Mon, 6 Mar 2023 15:07:53 +0200 Subject: [PATCH] topology2: mixer: Add no_wname_in_kcontrol_name attribute to gain class Adds "no_wname_in_kcontrol_name" boolean attribute to gain class, with "true" as default value. With this change no mixer name will have widget name added to it. For example "gain.2.1 Post Mixer Analog Playback Volume" becomes just "Post Mixer Analog Playback Volume". If for some reason the widget name is needed in the mixer name, then this behavior can be reverted by setting "no_wname_in_kcontrol_name" to true in the topology gain node in question. Signed-off-by: Jyri Sarha --- tools/topology/topology2/include/common/tokens.conf | 1 + .../topology2/include/components/eqiir.conf | 1 + .../topology/topology2/include/components/gain.conf | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index 3277c7cb0497..534a43720b96 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -52,6 +52,7 @@ Object.Base.VendorToken { curve_type 260 curve_duration 261 init_value 262 + no_wname_in_kcontrol_name 263 } "6" { diff --git a/tools/topology/topology2/include/components/eqiir.conf b/tools/topology/topology2/include/components/eqiir.conf index 8d4f5bb37fad..5016e3af65b0 100644 --- a/tools/topology/topology2/include/components/eqiir.conf +++ b/tools/topology/topology2/include/components/eqiir.conf @@ -61,4 +61,5 @@ Class.Widget."eqiir" { no_pm "true" num_input_pins 1 num_output_pins 1 + no_wname_in_kcontrol_name "true" } diff --git a/tools/topology/topology2/include/components/gain.conf b/tools/topology/topology2/include/components/gain.conf index 395edb64ba94..373d5f04accb 100644 --- a/tools/topology/topology2/include/components/gain.conf +++ b/tools/topology/topology2/include/components/gain.conf @@ -68,6 +68,18 @@ Class.Widget."gain" { token_ref "gain.word" } + DefineAttribute."no_wname_in_kcontrol_name" { + type "string" + # Token set reference name + token_ref "gain.bool" + constraints { + !valid_values [ + "true" + "false" + ] + } + } + # Attribute categories attributes { # @@ -156,4 +168,5 @@ Class.Widget."gain" { init_value 0x7fffffff num_input_pins 1 num_output_pins 1 + no_wname_in_kcontrol_name "true" }