]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: pre-process-dapm: Add support for DAPM Widget objects
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 26 Apr 2021 19:45:01 +0000 (12:45 -0700)
committerJaroslav Kysela <perex@perex.cz>
Tue, 25 May 2021 16:26:51 +0000 (18:26 +0200)
Add support for pre-processing DAPM widget opbects.
For ex:

Object.Widget.pga."0" {
        pipeline_id     1
no_pm true
type pga
}

will be converted to:

SectionWidget.'pga.0' {
index 1
type pga
no_pm 1
}

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/pre-process-object.c

index 6988f8edf69cdfa02526672d1f90476eda429752..22f4d484a6bbe8e7fef355a4f1dca757fc5ef377 100644 (file)
@@ -846,6 +846,12 @@ static int tplg_build_generic_object(struct tplg_pre_processor *tplg_pp, snd_con
        return ret;
 }
 
+const struct config_template_items widget_config = {
+       .int_config_ids = {"index", "no_pm", "shift", "invert", "subseq", "event_type",
+                           "event_flags"},
+       .string_config_ids = {"type", "stream_name"},
+};
+
 const struct config_template_items data_config = {
        .string_config_ids = {"bytes"}
 };
@@ -854,6 +860,7 @@ const struct build_function_map object_build_map[] = {
        {"Base", "manifest", "SectionManifest", &tplg_build_generic_object, NULL},
        {"Base", "data", "SectionData", &tplg_build_data_object, &data_config},
        {"Base", "VendorToken", "SectionVendorTokens", &tplg_build_vendor_token_object, NULL},
+       {"Widget", "", "SectionWidget", &tplg_build_generic_object, &widget_config},
 };
 
 static const struct build_function_map *tplg_object_get_map(struct tplg_pre_processor *tplg_pp,