Skip to content

Commit

Permalink
topology: Parse ignore_suspend property for dapm widget
Browse files Browse the repository at this point in the history
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: #230
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
Amadeusz Sławiński authored and perexg committed Jan 29, 2023
1 parent e824f70 commit e11ea20
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/topology/dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e11ea20

Please sign in to comment.