From b0be2350244bd427aef448bf79336ee0f70648e0 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Mon, 26 Apr 2021 13:12:43 -0700 Subject: [PATCH] topology: pre-process-dai: add support for PCM and BE DAI objects Add support for pre-processing PCM and BE DAI objects: Object.PCM.pcm."0" { name "Port0" direction "duplex" } will be converted to: SectionPCM.'Port0' {} The capabilities and dai configs will be added those objects are pre-processed. An ex of DAI object would be: Object.Dai.SSP."0" { direction "duplex" stream_name "NoCodec-0" id 0 default_hw_conf_id 0 format "s24le" quirks "lbm_mode" sample_bits 24 } converted to: SectionBE { 'SSP.0.duplex' { id 0 stream_name NoCodec-0 default_hw_conf_id 0 data [ 'SSP.0.duplex.sof_tkn_intel_ssp.word' 'SSP.0.duplex.sof_tkn_dai.word' 'SSP.0.duplex.sof_tkn_dai.string' 'SSP.0.duplex.sof_tkn_intel_ssp.short' ] } Signed-off-by: Ranjani Sridharan Signed-off-by: Jaroslav Kysela --- topology/pre-process-object.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c index 1c8988d..5a8f472 100644 --- a/topology/pre-process-object.c +++ b/topology/pre-process-object.c @@ -858,6 +858,17 @@ static int tplg_build_generic_object(struct tplg_pre_processor *tplg_pp, snd_con return ret; } +const struct config_template_items be_dai_config = { + .int_config_ids = {"id", "default_hw_conf_id", "symmertic_rates", "symmetric_channels", + "symmetric_sample_bits"}, + .string_config_ids = {"stream_name"}, +}; + +const struct config_template_items pcm_config = { + .int_config_ids = {"id", "compress", "symmertic_rates", "symmetric_channels", + "symmetric_sample_bits"}, +}; + const struct config_template_items mixer_control_config = { .int_config_ids = {"index", "max", "invert"}, .compound_config_ids = {"access"} @@ -905,6 +916,8 @@ const struct build_function_map object_build_map[] = { &mixer_control_config}, {"Control", "bytes", "SectionControlBytes", &tplg_build_bytes_control, &bytes_control_config}, + {"Dai", "", "SectionBE", &tplg_build_generic_object, &be_dai_config}, + {"PCM", "pcm", "SectionPCM", &tplg_build_generic_object, &pcm_config}, }; static const struct build_function_map *tplg_object_get_map(struct tplg_pre_processor *tplg_pp, -- 2.47.1