]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: pre-process-dai: add support for fe_dai objects
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 26 Apr 2021 20:31:00 +0000 (13:31 -0700)
committerJaroslav Kysela <perex@perex.cz>
Tue, 25 May 2021 16:26:51 +0000 (18:26 +0200)
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 <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-dai.c
topology/pre-process-object.c
topology/pre-processor.h

index a8e790194977cb76f71f2ca4613a0bca1aa091b3..6ff378d3e24cd3549a783362958f7262307eb8e4 100644 (file)
@@ -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);
+}
index cbbdd6347f3dcf26696299b4dd55ee2b5f3a0ed2..d5359cb3cc59d5bfe156009b25671e6e09938508 100644 (file)
@@ -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,
index fd6e11531ef785e42bc2ac41dca0b41ec1dd1f47..6f4eb4c5ecc8a8d7ca3a5050bfc06fd6f270df0c 100644 (file)
@@ -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);