diff --git a/tools/topology2/include/common/tokens.conf b/tools/topology2/include/common/tokens.conf index 57af79010..15e0e5112 100644 --- a/tools/topology2/include/common/tokens.conf +++ b/tools/topology2/include/common/tokens.conf @@ -12,4 +12,12 @@ Object.Base.VendorToken { core_id 404 uuid 405 } + + "sof_tkn_dai" { + # Token retired with ABI 3.2, do not use for new capabilities + dmac_config 153 + dai_type 154 + dai_index 155 + direction 156 + } } diff --git a/tools/topology2/include/components/dai.conf b/tools/topology2/include/components/dai.conf new file mode 100644 index 000000000..f500b14ec --- /dev/null +++ b/tools/topology2/include/components/dai.conf @@ -0,0 +1,137 @@ +# +# A generic dai widget. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.dai.N.attribute_name" +# +# For playback +# Object.Widget.dai."playback" { +# dai_type SSP +# index 1 +# period_sink_count 2 +# period_source_count 0 +# type dai_in +# } +# +# For Capture +# Object.Widget.dai."capture" { +# dai_type SSP +# index 2 +# period_sink_count 0 +# period_source_count 2 +# type dai_out +# } +# + +Class.Widget."dai" { + # Type of DAI + DefineAttribute."dai_type" { + type "string" + token_ref "sof_tkn_dai.string" + constraints { + !valid_values [ + "SSP" + "DMIC" + "HDA" + "ALH" + "ESAI" + ] + } + } + + DefineAttribute."instance" {} + + # DAI Index in the firmware + DefineAttribute."dai_index" { + # Token reference and type + token_ref "sof_tkn_dai.word" + } + + # + # DAI direction. The string values will be converted to 0/1 and added as tuple data + # + DefineAttribute."direction" { + type "string" + token_ref "sof_tkn_dai.word" + constraints { + !valid_values [ + "playback" + "capture" + ] + !tuple_values [ + 0 + 1 + ] + } + } + + # include common widget attribute definitions + + + # + # Pipeline ID that the dai widget belongs to + # + DefineAttribute."index" {} + + DefineAttribute.uuid { + type "string" + # Token set reference name and type + token_ref "sof_tkn_comp.uuid" + } + + # Bespoke attributes for DAI + DefineAttribute."format" { + type "string" + # Token reference and type + token_ref "sof_tkn_comp.string" + } + + # Attribute categories + attributes { + # + # The DAI widget name would be constructed using the dai_type, index and direction + # attributes. For ex: "dai.SSP.1.capture" or "dai.ALH.2.playback" etc. + # + !constructor [ + "dai_type" + "dai_index" + "direction" + ] + + # + # mandatory attributes that must be provided when the dai widget class is instantiated + # + !mandatory [ + "type" + "stream_name" + "format" + "index" + "period_sink_count" + "period_source_count" + "format" + ] + + # + # immutable attributes cannot be modified in the object instance + # + !immutable [ + "uuid" + ] + + # + # deprecated attributes should not be added in the object instance + # + !deprecated [ + "preload_count" + ] + + # + # dai widget objects instantiated within the same alsaconf node must have unique + # direction attribute + # + unique "instance" + } + + # Default attribute values for DAI widget + uuid "27:0d:b0:c2:bc:ff:50:41:a5:1a:24:5c:79:c5:e5:4b" + no_pm "true" + core_id 0 +}