diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2016-03-14 08:07:38 +0000 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-03-14 16:57:38 +0100 |
commit | 8372062357ae1ab5e43f7a9b52a89344f01b0c48 (patch) | |
tree | 327c249f633066cfd381792afb12b26c49268f67 | |
parent | f5e0062258a84997aab3725c1fd6761fd51320c8 (diff) | |
download | alsa-lib-8372062357ae1ab5e43f7a9b52a89344f01b0c48.tar.gz |
topology: Add support for widget byte controls
Add support for DAPM widgets to include bytes controls.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/topology/dapm.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/topology/dapm.c b/src/topology/dapm.c index 14969eed..278d6056 100644 --- a/src/topology/dapm.c +++ b/src/topology/dapm.c @@ -103,6 +103,28 @@ static int tplg_parse_dapm_enums(snd_config_t *cfg, struct tplg_elem *elem) return 0; } +static int tplg_parse_dapm_bytes(snd_config_t *cfg, struct tplg_elem *elem) +{ + snd_config_iterator_t i, next; + snd_config_t *n; + const char *value = NULL; + + tplg_dbg(" DAPM Bytes Controls: %s\n", elem->id); + + snd_config_for_each(i, next, cfg) { + n = snd_config_iterator_entry(i); + + /* get value */ + if (snd_config_get_string(n, &value) < 0) + continue; + + tplg_ref_add(elem, SND_TPLG_TYPE_BYTES, value); + tplg_dbg("\t\t %s\n", value); + } + + return 0; +} + /* move referenced controls to the widget */ static int copy_dapm_control(struct tplg_elem *elem, struct tplg_elem *ref) { @@ -567,6 +589,14 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg, continue; } + if (strcmp(id, "bytes") == 0) { + err = tplg_parse_dapm_bytes(n, elem); + if (err < 0) + return err; + + continue; + } + if (strcmp(id, "data") == 0) { if (snd_config_get_string(n, &val) < 0) return -EINVAL; |