From a68b1af80d1ab35cccdcb581a4722e1578b0c122 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Thu, 18 Mar 2021 22:48:49 -0700 Subject: [PATCH] topology2: Add pga class Add the class definition for PGA widget. It can be instantiated as follows: Object.Widget.pga."N" { format s24le index 0 period_sink_count 2 period_source_count 2 } Where N is the unique instance number for pga widget in the same alsaconf node. Signed-off-by: Ranjani Sridharan --- tools/topology2/include/common/tokens.conf | 5 + .../topology2/include/components/volume.conf | 118 ++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 tools/topology2/include/components/volume.conf diff --git a/tools/topology2/include/common/tokens.conf b/tools/topology2/include/common/tokens.conf index e4fe83228..cccd74b8b 100644 --- a/tools/topology2/include/common/tokens.conf +++ b/tools/topology2/include/common/tokens.conf @@ -25,4 +25,9 @@ Object.Base.VendorToken { size 100 caps 101 } + + "sof_tkn_volume" { + ramp_step_type 250 + ramp_step_ms 251 + } } diff --git a/tools/topology2/include/components/volume.conf b/tools/topology2/include/components/volume.conf new file mode 100644 index 000000000..e77562476 --- /dev/null +++ b/tools/topology2/include/components/volume.conf @@ -0,0 +1,118 @@ +# +# Common pipeline volume +# +# A generic volume widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.pga.N.attribute_name" +# +# Usage: this component can be used by declaring int a parent object. i.e. +# +# Object.Widget.pga."N" { +# index 1 +# format s24le +# no_pm "true" +# } +# +# Where N is the unique instance number for pga widget in the same alsaconf node. + +Class.Widget."pga" { + # + # Pipeline ID for the pga widget object + # + DefineAttribute."index" {} + + # + # pga object instance + # + DefineAttribute."instance" {} + + #include common component definition + + + # + # pga widget UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # + # Bespoke attributes for PGA + # + + # + # Volume ramp step type. The values provided will be translated to integer values + # as specified in the tuple_values array. + # For example: "linear" is translated to 0, "log" to 1 etc. + # + DefineAttribute."ramp_step_type" { + type "string" + # Token set reference name + token_ref "sof_tkn_volume.word" + constraints { + !valid_values [ + "linear" + "log" + "linear_zc" + "log_zc" + ] + !tuple_values [ + 0 + 1 + 2 + 3 + ] + } + } + + # + # Volume ramp step in milliseconds + # + DefineAttribute."ramp_step_ms" { + # Token set reference name + token_ref "sof_tkn_volume.word" + } + + # Attribute categories + attributes { + # + # The PGA widget name would be constructed using the index and instance attributes. + # For ex: "pga.1.1" or "pga.10.2" etc. + # + !constructor [ + "index" + "instance" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + "type" + ] + + # + # deprecated attributes should not be added in the object instance + # + !deprecated [ + "preload_count" + ] + + # + # pga widget objects instantiated within the same alsaconf node must have unique + # instance attribute + # + unique "instance" + } + + # Default attribute values for pga widget + type "pga" + uuid "7e:67:7e:b7:f4:5f:88:41:af:14:fb:a8:bd:bf:86:82" + no_pm "true" + period_sink_count 2 + period_source_count 2 + ramp_step_type "linear" + ramp_step_ms 400 +}