diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index 00b32caf2..2e96e8b8b 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -56,4 +56,14 @@ Object.Base.VendorToken { "sof_tkn_copier" { cpc 1600 } + + "sof_tkn_intel_ssp" { + clks_control 500 + mclk_id 501 + sample_bits 502 + frame_pulse_width 503 + quirks 504 + tdm_padding_per_slot 505 + bclk_delay 506 + } } diff --git a/tools/topology/topology2/include/dais/ssp.conf b/tools/topology/topology2/include/dais/ssp.conf new file mode 100644 index 000000000..e2e8bbaee --- /dev/null +++ b/tools/topology/topology2/include/dais/ssp.conf @@ -0,0 +1,136 @@ +# +# SSP DAI class definition. All attributes defined herein are namespaced +# by alsatplg to "Object.Dai.SSP.N.attribute_name" +# +# Usage: SSP DAI objects can be instantiated as: +# +# Object.Dai.SSP."N" { +# direction "duplex" # playback, capture or duplex +# dai_name "NoCodec-0" +# id 0 +# quirks "lbm_mode" +# sample_bits 24 +# Object.hw_config."0" { +# mclk_freq 24000000 +# bclk_freq 4800000 +# tdm_slot_width 25 +# } +# Object.dai."playback" { +# period_source_count 2 +# period_sink_count 0 +# } +# Object.dai."capture" { +# period_source_count 0 +# period_sink_count 2 +# } +# } +# +# where N is the unique instance number for the SSP object within the same alsaconf node. + +# SSP port definition +Class.Dai."SSP" { + + # + # Argument used to construct DAI widget + # + # Playback DAI Index + DefineAttribute."dai_index" { + token_ref "sof_tkn_dai.word" + } + + DefineAttribute."direction" { + type "string" + constraints { + !valid_values [ + "playback" + "capture" + "duplex" + ] + } + } + + DefineAttribute."dai_type" { + type "string" + token_ref "sof_tkn_dai.string" + } + + DefineAttribute."default_hw_config_id" {} + + DefineAttribute."name" { + type "string" + } + + # Backend DAI Link ID matching with the machine driver + DefineAttribute."id" {} + + DefineAttribute."sample_bits" { + # Token reference and type + token_ref "sof_tkn_intel_ssp.word" + } + + DefineAttribute."bclk_delay" { + # Token reference and type + token_ref "sof_tkn_intel_ssp.word" + } + + DefineAttribute."tdm_padding_per_slot" { + type "string" + # Token reference and type + token_ref "sof_tkn_intel_ssp.bool" + constraints { + !valid_values [ + "true" + "false" + ] + } + } + + # SSP quirks. Value will translated based on sof_tkn_ssp_quirks. For ex: lb_mode will + # be converted to 64. + DefineAttribute."quirks" { + # Token reference and type + token_ref "sof_tkn_intel_ssp.word" + constraints { + !valid_values [ + "lbm_mode" + ] + !tuple_values [ + 64 + ] + + } + } + + DefineAttribute."mclk_id" { + # Token reference and type + token_ref "sof_tkn_intel_ssp.short" + } + + attributes { + constructor [ + "name" + ] + + mandatory [ + "id" + "sample_bits" + ] + + immutable [ + "dai_type" + ] + # + # SSP DAI objects instantiated within the same alsaconf node must have unique + # dai_index attribute + # + unique "dai_index" + } + + dai_type "SSP" + bclk_delay 0 + mclk_id 0 + default_hw_config_id 0 + clks_control 0 + frame_pulse_width 0 + tdm_padding_per_slot false +}