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 <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Ranjani Sridharan 2021-04-26 13:31:00 -07:00 committed by Jaroslav Kysela
parent 4bc386bb71
commit 3719c80a4d
3 changed files with 15 additions and 0 deletions

View 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);
}

View 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,

View 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);