diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index a96c62fd1..fe9bfbef1 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -31,6 +31,12 @@ Object.Base.VendorToken { ramp_step_ms 251 } + "sof_tkn_gain" { + curve_type 260 + curve_duration 261 + init_value 262 + } + "sof_tkn_src" { rate_in 300 rate_out 301 @@ -67,6 +73,11 @@ Object.Base.VendorToken { bclk_delay 506 } + "sof_tkn_mute_led" { + mute_led_use 1300 + mute_led_direction 1301 + } + "sof_tkn_alh" { rate 1400 channels 1401 diff --git a/tools/topology/topology2/include/components/gain.conf b/tools/topology/topology2/include/components/gain.conf new file mode 100644 index 000000000..13470d649 --- /dev/null +++ b/tools/topology/topology2/include/components/gain.conf @@ -0,0 +1,150 @@ +# +# Common pipeline gain (volume) +# +# A generic gain (volume) widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.gain.N.attribute_name" +# +# Usage: this component can be used by declaring int a parent object. i.e. +# +# Object.Widget.gain."N" { +# index 1 +# format s24le +# no_pm "true" +# } +# +# Where N is the unique instance number for gain widget in the same alsaconf node. + +Class.Widget."gain" { + # + # Pipeline ID for the gain widget object + # + DefineAttribute."index" {} + + # + # gain object instance + # + DefineAttribute."instance" {} + + #include common component definition + + + # + # gain widget UUID + # + DefineAttribute."uuid" { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # + # Bespoke attributes for PGA + # + + # + # Gain curve 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."curve_type" { + type "string" + # Token set reference name + token_ref "sof_tkn_gain.word" + constraints { + !valid_values [ + "linear" + "log" + ] + !tuple_values [ + 0 + 1 + ] + } + } + + # + # Gain curve in milliseconds + # + DefineAttribute."curve_duration" { + # Token set reference name + token_ref "sof_tkn_gain.word" + } + + DefineAttribute."init_value" { + # Token set reference name + token_ref "sof_tkn_gain.word" + } + + # Attribute categories + attributes { + # + # The PGA widget name would be constructed using the index and instance attributes. + # For ex: "gain.1.1" or "gain.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" + ] + + # + # gain widget objects instantiated within the same alsaconf node must have unique + # instance attribute + # + unique "instance" + } + + # + # gain widget mixer controls + # + Object.Control { + # gain mixer control + mixer."1" { + #Channel register and shift for Front Left/Right + Object.Base.channel."fl" { + shift 0 + } + Object.Base.channel."fr" {} + + Object.Base.ops."ctl" { + info "volsw" + #256 binds the mixer control to volume get/put handlers + get 256 + put 256 + } + max 66 + + Object.Base.tlv."vtlv_m64s1" { + Object.Base.scale."m64s1" { + min 1354970 + step 1 + mute 1 + } + } + } + } + + # Default attribute values for gain widget + type "pga" + uuid "A8:A9:BC:61:D0:18:18:4A:8E:7B:26:39:21:98:04:B7" + no_pm "true" + period_sink_count 2 + period_source_count 2 + curve_type "linear" + curve_duration 10 + init_value 0x6fffffff +} diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf new file mode 100644 index 000000000..e00b4695b --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -0,0 +1,69 @@ +# +# CAVS gain (volume) capture pipeline +# +# A simple gain (volume) pipeline. All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.gain-capture.N.attribute_name". +# +# Usage: gain-capture pipeline object can be instantiated as: +# +# Object.Pipeline.gain-capture."N" { +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + +Class.Pipeline."gain-capture" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !mandatory [ + "format" + ] + + !immutable [ + "direction" + ] + + # + # gain-capture objects instantiated within the same alsaconf node must have + # unique pipeline_id attribute + # + unique "index" + } + + Object.Widget { + copier."1" { + copier_type "host" + type "aif_out" + } + + gain."1" { + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + direction "capture" + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +} diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf new file mode 100644 index 000000000..b8001d2c8 --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf @@ -0,0 +1,69 @@ +# +# CAVS gain (volume) playback pipeline +# +# A simple gain (volume) pipeline. All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.gain-playback.N.attribute_name" +# +# Usage: gain-playback pipeline object can be instantiated as: +# +# Object.Pipeline.gain-playback."N" { +# format "s16le" +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + +Class.Pipeline."gain-playback" { + + DefineAttribute."index" {} + + + + attributes { + !constructor [ + "index" + ] + + !mandatory [ + "format" + ] + + !immutable [ + "direction" + ] + + # + # gain-playback objects instantiated within the same alsaconf node must have + # unique pipeline_id attribute + # + unique "index" + } + + Object.Widget { + copier."1" { + copier_type "host" + type "aif_in" + } + + gain."1" { + } + + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + direction "playback" + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +}