summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMengdong Lin <mengdong.lin@linux.intel.com>2016-10-24 21:22:02 +0800
committerTakashi Iwai <tiwai@suse.de>2016-10-25 09:24:28 +0200
commitadb9866b70bb8f30b08a0974d72a0256e689143d (patch)
treee0906a6f60080587ed8d660ec9ec15260232bffb
parentced8722f7d98c946d1429e46252ccc061272d0db (diff)
downloadalsa-lib-adb9866b70bb8f30b08a0974d72a0256e689143d.tar.gz
topology: Fix missing stream name of widgets in text conf file
User can define the stream name of an input/output widget in the text conf file, by setting "stream_name" of a SectionWidget. Topology C API and kernel already have support for configuring a widget's stream name. This patch just adds the missing part of the text conf file. Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/topology.h1
-rw-r--r--src/topology/dapm.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/include/topology.h b/include/topology.h
index 0675b527..a0d018e4 100644
--- a/include/topology.h
+++ b/include/topology.h
@@ -483,6 +483,7 @@ extern "C" {
* index "1" # Index number
*
* type "aif_in" # Widget type - detailed above
+ * stream_name "name" # Stream name
*
* no_pm "true" # No PM control bit.
* reg "20" # PM bit register offset
diff --git a/src/topology/dapm.c b/src/topology/dapm.c
index e3c90d83..9fa0aac0 100644
--- a/src/topology/dapm.c
+++ b/src/topology/dapm.c
@@ -507,6 +507,16 @@ int tplg_parse_dapm_widget(snd_tplg_t *tplg,
continue;
}
+ if (strcmp(id, "stream_name") == 0) {
+ if (snd_config_get_string(n, &val) < 0)
+ return -EINVAL;
+
+ elem_copy_text(widget->sname, val,
+ SNDRV_CTL_ELEM_ID_NAME_MAXLEN);
+ tplg_dbg("\t%s: %s\n", id, val);
+ continue;
+ }
+
if (strcmp(id, "no_pm") == 0) {
if (snd_config_get_string(n, &val) < 0)
return -EINVAL;