pre-process-dapm: add data section for kcontrols

Allow support for adding data section for kcontrols.

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-06-15 16:15:06 -07:00 committed by Jaroslav Kysela
parent 3d55a99ccd
commit b13a940618
3 changed files with 8 additions and 2 deletions

View file

@ -115,6 +115,10 @@ static int tplg_build_control(struct tplg_pre_processor *tplg_pp, snd_config_t *
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = tplg_add_object_data(tplg_pp, obj_cfg, cfg, NULL);
if (ret < 0)
SNDERR("Failed to add data section for %s\n", name);
return tplg_parent_update(tplg_pp, parent, type, name); return tplg_parent_update(tplg_pp, parent, type, name);
} }

View file

@ -664,8 +664,8 @@ static int tplg_pp_add_object_data_section(struct tplg_pre_processor *tplg_pp,
return snd_config_set_string(child, data_name); return snd_config_set_string(child, data_name);
} }
static int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
snd_config_t *top, const char *array_name) snd_config_t *top, const char *array_name)
{ {
snd_config_iterator_t i, next; snd_config_iterator_t i, next;
snd_config_t *data_cfg, *class_cfg, *n, *obj; snd_config_t *data_cfg, *class_cfg, *n, *obj;

View file

@ -83,6 +83,8 @@ int tplg_parent_update(struct tplg_pre_processor *tplg_pp, snd_config_t *parent,
const char *section_name, const char *item_name); const char *section_name, const char *item_name);
int tplg_update_buffer_auto_attr(struct tplg_pre_processor *tplg_pp, int tplg_update_buffer_auto_attr(struct tplg_pre_processor *tplg_pp,
snd_config_t *buffer_cfg, snd_config_t *parent); snd_config_t *buffer_cfg, snd_config_t *parent);
int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg,
snd_config_t *top, const char *array_name);
/* object helpers */ /* object helpers */
int tplg_pre_process_objects(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg, int tplg_pre_process_objects(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg,