]> git.alsa-project.org Git - alsa-utils.git/commitdiff
pre-process-dapm: add data section for kcontrols
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Tue, 15 Jun 2021 23:15:06 +0000 (16:15 -0700)
committerJaroslav Kysela <perex@perex.cz>
Mon, 23 Aug 2021 14:49:56 +0000 (16:49 +0200)
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>
topology/pre-process-dapm.c
topology/pre-process-object.c
topology/pre-processor.h

index 7ae431ab07ea9f82d4c6033ffd65e083f2e2b6ad..5ab42fde0b238c2145e0c0418b7969a4ee100dce 100644 (file)
@@ -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);
 }
 
index c5a132b9ef5aa6813daa96c2182a3fd75a95cca6..43f8930d07bc50299decc8ea41f7ef1d31faccd5 100644 (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);
 }
 
-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;
index 0a8bd77c20dc5059a0897955ac7950a2af899451..c534ead65382ed155821b97145b7dd0f3ad8c6ec 100644 (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);
 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,