From: Ranjani Sridharan Date: Mon, 26 Apr 2021 20:31:00 +0000 (-0700) Subject: topology: pre-process-dai: add support for fe_dai objects X-Git-Tag: v1.2.5~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=3719c80a4dd33fe4b01beb69e85a33fb7cea5d6b;p=alsa-utils.git topology: pre-process-dai: add support for fe_dai objects Add support for fe_dai objects: For ex: Object.PCM.pcm."0" { name "Port0" direction "duplex" Object.Base.fe_dai."Port 0" {} } will be converted to update the SectionPCM as follows: SectionPCM { Port0 { id 0 dai { 'Port 0' { id 0 } } } Signed-off-by: Ranjani Sridharan Signed-off-by: Jaroslav Kysela --- diff --git a/topology/pre-process-dai.c b/topology/pre-process-dai.c index a8e7901..6ff378d 100644 --- a/topology/pre-process-dai.c +++ b/topology/pre-process-dai.c @@ -45,3 +45,9 @@ int tplg_build_hw_cfg_object(struct tplg_pre_processor *tplg_pp, return tplg_parent_update(tplg_pp, parent, "hw_configs", name); } + +int tplg_build_fe_dai_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, + snd_config_t *parent) +{ + return tplg_build_base_object(tplg_pp, obj_cfg, parent, false); +} diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c index cbbdd63..d5359cb 100644 --- a/topology/pre-process-object.c +++ b/topology/pre-process-object.c @@ -858,6 +858,10 @@ static int tplg_build_generic_object(struct tplg_pre_processor *tplg_pp, snd_con return ret; } +const struct config_template_items fe_dai_config = { + .int_config_ids = {"id"}, +}; + const struct config_template_items hwcfg_config = { .int_config_ids = {"id", "bclk_freq", "bclk_invert", "fsync_invert", "fsync_freq", "mclk_freq", "pm_gate_clocks", "tdm_slots", "tdm_slot_width", @@ -919,6 +923,7 @@ const struct build_function_map object_build_map[] = { {"Base", "VendorToken", "SectionVendorTokens", &tplg_build_vendor_token_object, NULL}, {"Base", "hw_config", "SectionHWConfig", &tplg_build_hw_cfg_object, &hwcfg_config}, + {"Base", "fe_dai", "dai", &tplg_build_fe_dai_object, &fe_dai_config}, {"Base", "route", "SectionGraph", &tplg_build_dapm_route_object, NULL}, {"Widget", "", "SectionWidget", &tplg_build_generic_object, &widget_config}, {"Control", "mixer", "SectionControlMixer", &tplg_build_mixer_control, diff --git a/topology/pre-processor.h b/topology/pre-processor.h index fd6e115..6f4eb4c 100644 --- a/topology/pre-processor.h +++ b/topology/pre-processor.h @@ -69,6 +69,10 @@ int tplg_build_dapm_route_object(struct tplg_pre_processor *tplg_pp, snd_config_ snd_config_t *parent); int tplg_build_hw_cfg_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, snd_config_t *parent); +int tplg_build_fe_dai_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, + snd_config_t *parent); +int tplg_build_base_object(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, + snd_config_t *parent, bool skip_name); int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent, const char *section_name, const char *item_name);