From patchwork Mon Feb 19 06:05:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10227171 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 5A4FB60392 for ; Mon, 19 Feb 2018 06:06:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 489B3287A6 for ; Mon, 19 Feb 2018 06:06:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D07428911; Mon, 19 Feb 2018 06:06:16 +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 83786287A6 for ; Mon, 19 Feb 2018 06:06:15 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 05225267344; Mon, 19 Feb 2018 07:06:14 +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 2497A267364; Mon, 19 Feb 2018 07:06:12 +0100 (CET) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by alsa0.perex.cz (Postfix) with ESMTP id 2BD08267351 for ; Mon, 19 Feb 2018 07:06:10 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id t3so12872410wmc.2 for ; Sun, 18 Feb 2018 22:06:10 -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=+6nmZSbbZEtxqvo5i/YzEOlwc4nGFXWnOzhEZNm6I6Q=; b=WeJxEEa4jrvxc3pjKgJRU8yfNmthMuNp6sDspqYldo4uLbmYVGk8v23fzEVXWcAVhK J5l3h32PqIlUdgjXCcYXiwctfwrKFgJ1DWI0Ej4KVPQYbdiqzPm5R+Psyvn3FQVL7lxy JLj1q5wEMBfdIxAn+9uinC/f+UjCunk+eMUJtqW9NNOe75O7XGR5gAD+ctQXrTT+aQnH BDRDvZzvkjUWD4c7JvltM7nEZlovXU4d6x3/ItTaKPip2N6UWLvN6BvKWIBgs79RY4KH +fKTn7S7fPqIMdLm+vuwsHU2BEFLx7ewytzaqOikzqySYBu3M47ife9TeGiGb07h6bvY Glkw== 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=+6nmZSbbZEtxqvo5i/YzEOlwc4nGFXWnOzhEZNm6I6Q=; b=uU9rnsRegx7YB/3RrfK5TlZRVdWv9fCOqYMFUiYh0FctTfJLciJcdpP7tRDEoczUn/ X48upqEc+uLHjkE5lI8cBS5FMTwWeDirSAn9CDqW/Dm1KYqsw2NTFzvso8qIr5qL6GdS CEjp5JEvwo1q8/HLvoIWJFCN/BinAG3k6O+05e9m+FybuvSWp3Q8qpkIYI8aHfMMGSBN WXlnEs1Vecuyj541fTirRRPdDevy0RF/0FEbSnsFZ7WfygcaimPyvS6ycCT9nVRs1vld lqUdkctbroI57OFAqQ09+nrWJyGgxP8bnsqkxYJvJXRXGK8AoPGk4zlaQ9S3CcOr6XPp jMRw== X-Gm-Message-State: APf1xPD5zqew0TAo9gnEPhuSrTnXCHz1VMYqRBOlyAO8G/J7stXu0LM9 VlAxOzrCagS4GWOx3DG7oVQ= X-Google-Smtp-Source: AH8x227yDNJoEveoipQxTv+79pgbV/o1+RNxlA+2rGv1SBi55mn1MWF4KgjeLu+PTFYpandGZH4ULQ== X-Received: by 10.28.234.18 with SMTP id i18mr10205508wmh.75.1519020369753; Sun, 18 Feb 2018 22:06:09 -0800 (PST) Received: from gentoo0.localdomain (x4e3351bc.dyn.telefonica.de. [78.51.81.188]) by smtp.gmail.com with ESMTPSA id k45sm443496wrf.62.2018.02.18.22.06.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Feb 2018 22:06:09 -0800 (PST) From: Kirill Marinushkin To: linux-kernel@vger.kernel.org Date: Mon, 19 Feb 2018 07:05:31 +0100 Message-Id: <20180219060531.17276-2-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180219060531.17276-1-k.marinushkin@gmail.com> References: <20180219060531.17276-1-k.marinushkin@gmail.com> Cc: alsa-devel@alsa-project.org, Takashi Iwai , Liam Girdwood , Mark Brown , Kirill Marinushkin Subject: [alsa-devel] [PATCH 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_cont_clock "true" # clock is continuous, and can not 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: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/soc/soc-topology.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 01a50413c66f..21bd4f96348d 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1981,6 +1981,12 @@ 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_cont) + link->dai_fmt |= SND_SOC_DAIFMT_CONT; + else + link->dai_fmt |= SND_SOC_DAIFMT_GATED; + /* clock signal polarity */ invert_bclk = hw_config->invert_bclk; invert_fsync = hw_config->invert_fsync;