From patchwork Sun Aug 27 13:38:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 111080 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3583243qge; Sun, 27 Aug 2017 06:40:19 -0700 (PDT) X-Received: by 10.223.142.234 with SMTP id q97mr1071125wrb.320.1503841219505; Sun, 27 Aug 2017 06:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503841219; cv=none; d=google.com; s=arc-20160816; b=zLGng4hhcyxfIhmLSJI3apA6sV+0PQ4c1ea+/U2iL4pHT6s2Ag8DylXcepdugpW4E1 EN/jVrlqKd9P8GzLA5hvJ13DX/UbbBtMh8JsjWQJkfYl5UiiZDSTLqatauJpDeQMpsvo jkmUy25KEYGt7ewnb9PuXFJtLeicIHBmWhcjr03yhb8SnSaLlow4ub76Wll2bQv5uNn2 yqq2Zb65KMTarWqH6+5FkR3ZocxZTwRBo+8dhUvKGmh2swwAgGU22hqcgGjcUt61TEOT 78NggsrqOsUqaEH/ydufCUhw68E8Ek5gruwYXyk5ya3E2VynBrFmEih2/+6WunZYjUR7 Ix5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=kv26pza2eeJv21F9PdQ+ial87yuJXhFc/FSQhpNe9CQ=; b=Itsd3g8h5GcLVM7oj8YhGsHKPFSZ22yjcJ12JaJHaz2K6u2MtNVsfv50WK2IUKq/0c c8XnPxCtYeTYIVDnCCJhvZbl7L5NAGf8DCYzP70IfLeQBUZIAF/KF9E4MSh9yuM1vfvT REWXjdik+iCLuPahhvigHtHqMehjgXr4wAKwVrjuUNgmbN07ZTuR5sY+7zdS5kjC7kKd Gog0vPCM0Se8XsjcITSt/A56m0REclFxTfUzYhRCosDpJlhPtZEOjYOgSIN3pXUTX1NP PqXbdv25WAbqw8A1HzJ0yBaCl6YsJE6e/BcjdPzCtzh2Hf18hUfuSRID09j4ant4cfAq gi2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Ooo64exJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id g196si4504876wmd.24.2017.08.27.06.40.19; Sun, 27 Aug 2017 06:40:19 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Ooo64exJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 33DA02674B8; Sun, 27 Aug 2017 15:40:02 +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 03A022675A7; Sun, 27 Aug 2017 15:40:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 2DB37267475 for ; Sun, 27 Aug 2017 15:38:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=DroFK0fXYoDCA6PFHypXn2NVjDyKnLRvel2ZGzTsOXk=; b=Ooo64exJyQqx Ui963hQDMNZIfnG5lLxLstNarDsHKgJxxu0veza+U4LQe5wIvQ0KWZ4ON5rc/Ab9F58E8lnYi03Ww qurvSePgMrRYnsQ1CZAmQmYS7f5/n1HxxkHFY6Sh8jZXPOMRcM4QEKU9IYHokV8FoRHrNvtGcnh+N o9jG4=; Received: from [2001:4d48:ad55:2401:7e7a:91ff:fede:4a45] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dlxmD-0005TX-DB; Sun, 27 Aug 2017 13:38:57 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 093E34400E7; Sun, 27 Aug 2017 14:38:57 +0100 (BST) From: Mark Brown To: Shreyas NC In-Reply-To: <20170821084646.6525-4-guneshwor.o.singh@intel.com> Message-Id: <20170827133857.093E34400E7@finisterre.ee.mobilebroadband> Date: Sun, 27 Aug 2017 14:38:57 +0100 (BST) Cc: alsa-devel@alsa-project.org, Takashi Iwai , Guneshwor Singh , Liam Girdwood , Patches Audio , Mark Brown , Vinod Koul Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Commonize parsing of format tokens" to the asoc tree 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 The patch ASoC: Intel: Skylake: Commonize parsing of format tokens has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From ca312fda690e94c704bcb0e21b73b5d5bd1cf1ff Mon Sep 17 00:00:00 2001 From: Shreyas NC Date: Wed, 23 Aug 2017 19:33:50 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Commonize parsing of format tokens Format resource tokens can be a part of either the widget or manifest private data. In the current model, format resources come as a part of widget private data and they come as a part of topology manifest in the newly introduced model. So add a common function that can fill up either of the structures. Signed-off-by: Shreyas NC Signed-off-by: Guneshwor Singh Acked-By: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-topology.c | 47 +++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 21 deletions(-) -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index f14b373f65d7..df808fbf14b5 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -1948,27 +1948,9 @@ static int skl_tplg_fill_pins_info(struct device *dev, * on the direction */ static int skl_tplg_fill_fmt(struct device *dev, - struct skl_module_cfg *mconfig, u32 tkn, - u32 value, u32 dir, u32 pin_count) + struct skl_module_fmt *dst_fmt, + u32 tkn, u32 value) { - struct skl_module_fmt *dst_fmt; - - switch (dir) { - case SKL_DIR_IN: - dst_fmt = mconfig->in_fmt; - dst_fmt += pin_count; - break; - - case SKL_DIR_OUT: - dst_fmt = mconfig->out_fmt; - dst_fmt += pin_count; - break; - - default: - dev_err(dev, "Invalid direction value\n"); - return -EINVAL; - } - switch (tkn) { case SKL_TKN_U32_FMT_CH: dst_fmt->channels = value; @@ -2010,6 +1992,29 @@ static int skl_tplg_fill_fmt(struct device *dev, return 0; } +static int skl_tplg_widget_fill_fmt(struct device *dev, + struct skl_module_cfg *mconfig, + u32 tkn, u32 val, u32 dir, int fmt_idx) +{ + struct skl_module_fmt *dst_fmt; + + switch (dir) { + case SKL_DIR_IN: + dst_fmt = &mconfig->in_fmt[fmt_idx]; + break; + + case SKL_DIR_OUT: + dst_fmt = &mconfig->out_fmt[fmt_idx]; + break; + + default: + dev_err(dev, "Invalid direction: %d\n", dir); + return -EINVAL; + } + + return skl_tplg_fill_fmt(dev, dst_fmt, tkn, val); +} + static int skl_tplg_get_uuid(struct device *dev, struct skl_module_cfg *mconfig, struct snd_soc_tplg_vendor_uuid_elem *uuid_tkn) { @@ -2190,7 +2195,7 @@ static int skl_tplg_get_token(struct device *dev, case SKL_TKN_U32_FMT_INTERLEAVE: case SKL_TKN_U32_FMT_SAMPLE_TYPE: case SKL_TKN_U32_FMT_CH_MAP: - ret = skl_tplg_fill_fmt(dev, mconfig, tkn_elem->token, + ret = skl_tplg_widget_fill_fmt(dev, mconfig, tkn_elem->token, tkn_elem->value, dir, pin_index); if (ret < 0)