From: mengdong.lin@linux.intel.com
To: alsa-devel@alsa-project.org
Cc: Mengdong Lin <mengdong.lin@linux.intel.com>,
tiwai@suse.de, hardik.t.shah@intel.com,
guneshwor.o.singh@intel.com, liam.r.girdwood@linux.intel.com,
vinod.koul@intel.com, broonie@kernel.org, mengdong.lin@intel.com
Subject: [PATCH v2 1/3] topology: Fix missing stream name of widgets in text conf file
Date: Thu, 20 Oct 2016 13:48:27 +0800 [thread overview]
Message-ID: <ee4f92404be88a9d0a97df121b021e0b9d2054ad.1476941614.git.mengdong.lin@linux.intel.com> (raw)
In-Reply-To: <cover.1476941614.git.mengdong.lin@linux.intel.com>
From: Mengdong Lin <mengdong.lin@linux.intel.com>
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>
diff --git a/include/topology.h b/include/topology.h
index 0675b52..a0d018e 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 e3c90d8..9fa0aac 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;
--
2.5.0
next prev parent reply other threads:[~2016-10-20 5:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 5:46 [PATCH v2 0/3] topology: Support widgets' stream name and file inclusion for text conf file mengdong.lin
2016-10-20 5:48 ` mengdong.lin [this message]
2016-10-20 5:48 ` [PATCH v2 2/3] alsaconf: Search included files under global configuration directories mengdong.lin
2016-10-21 15:04 ` Takashi Iwai
2016-10-24 13:23 ` Mengdong Lin
2016-10-20 5:48 ` [PATCH v2 3/3] topology: Add doc for including other files in the text conf file mengdong.lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ee4f92404be88a9d0a97df121b021e0b9d2054ad.1476941614.git.mengdong.lin@linux.intel.com \
--to=mengdong.lin@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=guneshwor.o.singh@intel.com \
--cc=hardik.t.shah@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=mengdong.lin@intel.com \
--cc=tiwai@suse.de \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).