From patchwork Thu Oct 20 05:48:51 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: 9385977 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 1BD2860487 for ; Thu, 20 Oct 2016 06:39:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0452B29AC9 for ; Thu, 20 Oct 2016 06:39:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7B5229ACC; Thu, 20 Oct 2016 06:39:26 +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 3180029AC9 for ; Thu, 20 Oct 2016 06:39:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 76645267055; Thu, 20 Oct 2016 08:39:24 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E4263266218; Thu, 20 Oct 2016 08:37:06 +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 11C4D267040; Thu, 20 Oct 2016 07:47:54 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by alsa0.perex.cz (Postfix) with ESMTP id 48266267017 for ; Thu, 20 Oct 2016 07:47:47 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 19 Oct 2016 22:47:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.31,517,1473145200"; d="scan'208"; a="1056449251" Received: from amanda-haswell-pc.sh.intel.com ([10.239.159.21]) by fmsmga001.fm.intel.com with ESMTP; 19 Oct 2016 22:47:45 -0700 From: mengdong.lin@linux.intel.com To: alsa-devel@alsa-project.org Date: Thu, 20 Oct 2016 13:48:51 +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 3/3] topology: Add doc for including other files in the 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 This patch adds document about how to include other files in the text configuration files, by alsaconf syntax and . Users may define common info in separate files (e.g. vendor tokens, tuples) and share them for different platforms, by including them via syntax . This can save the total size of files. Users can also specifiy additional configuraiton directories relative to "usr/share/alsa/" to search the included files, via syntax . The alsaconf will search and open an included file in the following order of priority: 1. directly open the file by its name; 2. search for the file name in "usr/share/alsa"; 3. search for the file name in user specified subdirectories under "usr/share/alsa". The order of the included files need not to be same as their dependencies, because the toplogy library will load all of them before parsing their dependencies. Signed-off-by: Mengdong Lin diff --git a/include/topology.h b/include/topology.h index a0d018e..c3449fd 100644 --- a/include/topology.h +++ b/include/topology.h @@ -624,6 +624,36 @@ extern "C" { * data "name" # optional private data * } * + * + *

Include other files

+ * Users may include other files in a text conf file via alsaconf syntax + * . This allows users to define common info + * in separate files (e.g. vendor tokens, tuples) and share them for + * different platforms, thus save the total size of config files.
+ * Users can also specifiy additional configuraiton directories relative + * to "usr/share/alsa/" to search the included files, via alsaconf syntax + * .

+ * + * For example, file A and file B are two text conf files for platform X, + * they will be installed to /usr/share/alsa/topology/platformx. If we + * need file A to include file B, in file A we can add:
+ * + *
+ *

+ * + * ALSA conf will search and open an included file in the following order + * of priority: + * 1. directly open the file by its name; + * 2. search for the file name in "usr/share/alsa"; + * 3. search for the file name in user specified subdirectories under + * "usr/share/alsa". + * + * The order of the included files need not to be same as their + * dependencies, since the topology library will load them all before + * parsing their dependencies.
+ * + * The configuration directories defined by a file will only be used to search + * the files included by this file. */ /** Maximum number of channels supported in one control */