From patchwork Thu Oct 20 05:48:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mengdong.lin@linux.intel.com X-Patchwork-Id: 9385965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3DD9E607F0 for ; Thu, 20 Oct 2016 06:04:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D9362966D for ; Thu, 20 Oct 2016 06:04:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2104F29AA0; Thu, 20 Oct 2016 06:04:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94E3029A8C for ; Thu, 20 Oct 2016 06:04:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 11531267040; Thu, 20 Oct 2016 08:04:52 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 96593267029; Thu, 20 Oct 2016 08:02:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6B065267029; Thu, 20 Oct 2016 07:47:30 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id A24842666CF for ; Thu, 20 Oct 2016 07:47:24 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP; 19 Oct 2016 22:47:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,517,1473145200"; d="scan'208";a="21948704" Received: from amanda-haswell-pc.sh.intel.com ([10.239.159.21]) by orsmga004.jf.intel.com with ESMTP; 19 Oct 2016 22:47:20 -0700 From: mengdong.lin@linux.intel.com To: alsa-devel@alsa-project.org Date: Thu, 20 Oct 2016 13:48:27 +0800 Message-Id: X-Mailer: git-send-email 2.5.0 In-Reply-To: References: Cc: Mengdong Lin , 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: [alsa-devel] [PATCH v2 1/3] topology: Fix missing stream name of widgets in text conf file X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mengdong Lin 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 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;