From patchwork Mon Feb 19 20:36:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10229017 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 6689C602B1 for ; Mon, 19 Feb 2018 20:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 558BF28770 for ; Mon, 19 Feb 2018 20:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 492E928B0B; Mon, 19 Feb 2018 20:36:47 +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 A595F28770 for ; Mon, 19 Feb 2018 20:36:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 73ED92674F7; Mon, 19 Feb 2018 21:36:44 +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 9DEB92674F7; Mon, 19 Feb 2018 21:36:43 +0100 (CET) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by alsa0.perex.cz (Postfix) with ESMTP id 958F82674F0 for ; Mon, 19 Feb 2018 21:36:40 +0100 (CET) Received: by mail-wr0-f196.google.com with SMTP id o76so10929600wrb.7 for ; Mon, 19 Feb 2018 12:36:39 -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=cycsdWXRgv6r7kggQh7puRltgbZfl6TuJ9Cr2ynpqNY=; b=tkH1gofjTA/DTa+HxvaQcDzps9BwJv3tt16XUCOfpvEz7LR7xayXTDTHZr83OUgO2K akNIeBWNpttOkGo1wR4M9anQZiybuvUfcaVxR9ceY3j0cfJ7097b0u+E2j4a5a+wW8HC LcTVVL2Gv4oveKPn2Tr6+eBUQ+zBocQ18PWC058q2bI7zcd+jQire7p4RngOfN6peXuz NgIor+cG18c4yRs6GVc0/+P03JdRqvwWrrHyHP7uAbMxUem/BIP5Yeko6s9+p91SHD8I yP4cVjbDE43T6qQeLAdGxqyq/FcdaQVKNZ90N17dlY2/yJDKwQ/4MsVI0hRaheIwYH0y T4HA== 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=cycsdWXRgv6r7kggQh7puRltgbZfl6TuJ9Cr2ynpqNY=; b=TkCHfmc2VsREOzeQ4ZknfkpOwHfDuut+S0Qnq4luYayKwnot+jBT8VEdeJ8VMQNb78 bH3iqStFkj+6ee2/yM1lsp9Y2LDiSAo7DrPTl5JfUpGT2PyYtDRb4EOqxl29JOar29pR ccRuoP+Z6OXi/hG1Fzke8g4i+oH2lH+PGJ/3OEAxoVWklH7zRGxRwmpMe+ChQ5TpEKst Xt1co0ZU3Uq0Vzu235klY6aT9TF5+oafydJERXHx6Iczo8uWJmsDZXAlXWTEhhe7T7oY fXRtx1PuFd4fBQhNZ+BRflBlJ8ddIj8CSih2MhTegUlYBEOO222z4g8M+g87iU1ZjxgS h6uw== X-Gm-Message-State: APf1xPCOD+2fav0kORCsksJ//XmcnGYsTmltYHAcd2IJM49rPb7v0b5I OTz1gnPtOFL0IMbvhjTKJ8k= X-Google-Smtp-Source: AH8x2253iqN7TqqC5szcL6aLfJA1H32MlEPYrN41hMZZK6XN0o6OKE9YqieclraET+hW7CrGTQQsSQ== X-Received: by 10.223.187.19 with SMTP id r19mr3683269wrg.110.1519072599711; Mon, 19 Feb 2018 12:36:39 -0800 (PST) Received: from gentoo0.localdomain (x4e3351bc.dyn.telefonica.de. [78.51.81.188]) by smtp.gmail.com with ESMTPSA id y107sm12197622wrc.24.2018.02.19.12.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 12:36:38 -0800 (PST) From: Kirill Marinushkin To: Takashi Sakamoto Date: Mon, 19 Feb 2018 21:36:35 +0100 Message-Id: <20180219203636.3692-2-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180219203636.3692-1-k.marinushkin@gmail.com> References: <458b66ab-da0a-8063-6555-13fb152c83a4@sakamocchi.jp> <20180219203636.3692-1-k.marinushkin@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown , Kirill Marinushkin Subject: [alsa-devel] [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: Takashi Sakamoto 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 | 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;