summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2021-05-25 17:09:21 +0200
committerJaroslav Kysela <perex@perex.cz>2023-01-29 18:55:53 +0100
commite11ea20645b46d88c3de6d995512e67143bd7f4e (patch)
tree9e33962350d0c05d2512d01736f815e0cb74cfd8
parente824f70d620404c2242d159d3e63074b5761e0e3 (diff)
downloadalsa-lib-e11ea20645b46d88c3de6d995512e67143bd7f4e.tar.gz
topology: Parse ignore_suspend property for dapm widget
snd_soc_tplg_dapm_widget has ignore_suspend field, but there is no way to set value for it, because we don't parse topology field for it. Fix this by adding parsing code. Fixes: https://github.com/alsa-project/alsa-lib/pull/230 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--src/topology/dapm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index f6a84a60..1c15ce8a 100644
--- a/src/topology/dapm.c
+++ b/src/topology/dapm.c
@@ -605,6 +605,17 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg,
continue;
}
+ if (strcmp(id, "ignore_suspend") == 0) {
+ ival = snd_config_get_bool(n);
+ if (ival < 0)
+ return -EINVAL;
+
+ widget->ignore_suspend = ival;
+
+ tplg_dbg("\t%s: %s", id, val);
+ continue;
+ }
+
if (strcmp(id, "subseq") == 0) {
if (tplg_get_integer(n, &ival, 0))
return -EINVAL;
@@ -700,6 +711,9 @@ int tplg_save_dapm_widget(snd_tplg_t *tplg ATTRIBUTE_UNUSED,
if (err >= 0 && widget->invert)
err = tplg_save_printf(dst, pfx, "\tinvert %u\n",
widget->invert);
+ if (err >= 0 && widget->ignore_suspend)
+ err = tplg_save_printf(dst, pfx, "\tignore_suspend %u\n",
+ widget->ignore_suspend);
if (err >= 0 && widget->subseq)
err = tplg_save_printf(dst, pfx, "\tsubseq %u\n",
widget->subseq);