From patchwork Tue Feb 20 17:44:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10230611 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 7D892601E7 for ; Tue, 20 Feb 2018 17:45:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BF5328821 for ; Tue, 20 Feb 2018 17:45:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6090328827; Tue, 20 Feb 2018 17:45:14 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no 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 9E2B828821 for ; Tue, 20 Feb 2018 17:45:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E874426753E; Tue, 20 Feb 2018 18:44:49 +0100 (CET) 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 6FEC4267544; Tue, 20 Feb 2018 18:44:48 +0100 (CET) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by alsa0.perex.cz (Postfix) with ESMTP id D7A6026753E for ; Tue, 20 Feb 2018 18:44:46 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id u49so12130799wrc.10 for ; Tue, 20 Feb 2018 09:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=loFzp5QYEfuhkTGamOEzowGU70VZVP70YTHav+vxpHA=; b=LT5r+EwENBZHCc+7EcBU1mTw61Ksxy+GchuLprODu8DwCOheVqpLyL+7S+SZE6gjYX echTTG5BspSEhage+4+V6x1XO26xekALNnKrhEyqK6KcXeXqc5AN2bEo7BThlauJo3bA Z+bpNhszJMwfWfMwWZCmXjrLE195uGkh2OqJ6ir2NYjrQBzd4V4XaaBqpFR9+Fq/m/89 cpXFRnW8lQMjBYavuaMP415p/SI7EsnxEVrGQN75biZ0JRtW+BQINDVM32YlKKlDxr5S 1RKQSRm+zQkNuh3uImOqB5XReTYgqux9EErgsKngJzP06lMKtfRjHZM1rsBRcqJtzhf7 omMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=loFzp5QYEfuhkTGamOEzowGU70VZVP70YTHav+vxpHA=; b=gz5HcN+bHnfwW0vGiZlPYAHCbQpX8laT3EyaWoLb9yEWGCi5ZsoB2NdyCmIO5b0nbQ MJN/gD3/4jk9LTN9WwHZdRUr7sv08yo8aKkGOjTOhDMChjHJlXGVS/C7T6RVqRcCghNV NMrezY0EaXFoDYghVscSz48Tb0O0WtGkar6GFyBhBwhkvXGCA38qvKAXSJP0mtMct/4P zBcANZvD45w3vyIzy3v8hPMab0Vt5zqwetEusrP8bfit5s++h/9Mv6hB+dK9oI5UC83t 7ST5H6T9p+bBYp+IovsH+0sMBGeOL99JX0sdEZqL9UJQ3OTzsASLNYNEfUsR9JwQIThc 9rwA== X-Gm-Message-State: APf1xPD3EcpKKLXPNarHOIIq3QO88Hu7Nk8SyhoLC9p5Yk0tZJZEJbhO iKLn2o3owuDHViTmTaCoT+c= X-Google-Smtp-Source: AH8x227PDbHT79vO0+9wHQ6GTd3fcT9z1dP9kWo4FfSvQfTyqWxXpIaXrsWX7Ws2D8D5s1g+8+kHbA== X-Received: by 10.28.137.140 with SMTP id l134mr829334wmd.137.1519148686096; Tue, 20 Feb 2018 09:44:46 -0800 (PST) Received: from gentoo0.localdomain (x4dbc326f.dyn.telefonica.de. [77.188.50.111]) by smtp.gmail.com with ESMTPSA id o94sm9353780wrc.7.2018.02.20.09.44.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 09:44:45 -0800 (PST) From: Kirill Marinushkin To: linux-kernel@vger.kernel.org Date: Tue, 20 Feb 2018 18:44:46 +0100 Message-Id: <20180220174446.7784-3-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180220174446.7784-1-k.marinushkin@gmail.com> References: <20180220174446.7784-1-k.marinushkin@gmail.com> Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Mark Brown , Takashi Sakamoto , Kirill Marinushkin Subject: [alsa-devel] [RESEND PATCH v2 2/2] ASoC: topology: Add missing clock gating parameter when parsing hw_configs 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 Clock gating parameter is a part of `dai_fmt`. It is supported by `alsa-lib` when creating a topology binary file, but ignored by kernel when loading this topology file. After applying this commit, the clock gating parameter is not ignored any more. The old behaviour is not broken, as by default the parameter value is 0. For example, the following config, based on alsa-lib/src/conf/topology/broadwell/broadwell.conf, is now supported: ~~~~ SectionHWConfig."CodecHWConfig" { id "1" format "I2S" # physical audio format. bclk "master" # Platform is master of bit clock fsync "master" # platform is master of fsync pm_gate_clocks "true" # clock can be gated } SectionLink."Codec" { # used for binding to the physical link id "0" hw_configs [ "CodecHWConfig" ] default_hw_conf_id "1" } ~~~~ Signed-off-by: Kirill Marinushkin Cc: Mark Brown Cc: Takashi Sakamoto Cc: Takashi Iwai Cc: Jaroslav Kysela Cc: Liam Girdwood Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/soc/soc-topology.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 01a50413c66f..bac70676a6b4 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1981,6 +1981,13 @@ static void set_link_hw_format(struct snd_soc_dai_link *link, link->dai_fmt = hw_config->fmt & SND_SOC_DAIFMT_FORMAT_MASK; + /* clock gating */ + if (hw_config->clock_gated == SND_SOC_TPLG_DAI_CLK_GATE_GATED) + link->dai_fmt |= SND_SOC_DAIFMT_GATED; + else if (hw_config->clock_gated == + SND_SOC_TPLG_DAI_CLK_GATE_CONT) + link->dai_fmt |= SND_SOC_DAIFMT_CONT; + /* clock signal polarity */ invert_bclk = hw_config->invert_bclk; invert_fsync = hw_config->invert_fsync;