From b13a94061862c0bd4874473d2fe78f65bbdc3c67 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Tue, 15 Jun 2021 16:15:06 -0700 Subject: [PATCH] pre-process-dapm: add data section for kcontrols Allow support for adding data section for kcontrols. Signed-off-by: Ranjani Sridharan Signed-off-by: Jaroslav Kysela --- topology/pre-process-dapm.c | 4 ++++ topology/pre-process-object.c | 4 ++-- topology/pre-processor.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/topology/pre-process-dapm.c b/topology/pre-process-dapm.c index 7ae431a..5ab42fd 100644 --- a/topology/pre-process-dapm.c +++ b/topology/pre-process-dapm.c @@ -115,6 +115,10 @@ static int tplg_build_control(struct tplg_pre_processor *tplg_pp, snd_config_t * if (ret < 0) 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); } diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c index c5a132b..43f8930 100644 --- a/topology/pre-process-object.c +++ b/topology/pre-process-object.c @@ -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); } -static int tplg_add_object_data(struct tplg_pre_processor *tplg_pp, snd_config_t *obj_cfg, - snd_config_t *top, const char *array_name) +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_iterator_t i, next; snd_config_t *data_cfg, *class_cfg, *n, *obj; diff --git a/topology/pre-processor.h b/topology/pre-processor.h index 0a8bd77..c534ead 100644 --- a/topology/pre-processor.h +++ b/topology/pre-processor.h @@ -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); int tplg_update_buffer_auto_attr(struct tplg_pre_processor *tplg_pp, 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 */ int tplg_pre_process_objects(struct tplg_pre_processor *tplg_pp, snd_config_t *cfg,