From patchwork Mon Apr 16 17:56:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Marinushkin X-Patchwork-Id: 10343613 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 EC64960542 for ; Mon, 16 Apr 2018 17:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD79028852 for ; Mon, 16 Apr 2018 17:56:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D06F428860; Mon, 16 Apr 2018 17:56:34 +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=-2.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID 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 37D7728852 for ; Mon, 16 Apr 2018 17:56:33 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 75C782673D3; Mon, 16 Apr 2018 19:56:31 +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 43E7E2673D4; Mon, 16 Apr 2018 19:56:29 +0200 (CEST) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by alsa0.perex.cz (Postfix) with ESMTP id 9D74E2673D2 for ; Mon, 16 Apr 2018 19:56:26 +0200 (CEST) Received: by mail-wr0-f196.google.com with SMTP id u46so28441668wrc.11 for ; Mon, 16 Apr 2018 10:56:26 -0700 (PDT) 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=vRvCBy0lOfTmbT+5XS73GokI8KbMBzcXHSleSL/eF68=; b=CFtEX0A1KEZ6l2Y6DwJ7RpIIc9lxDGVX5LTVGmqY3jaJRTamOlguQFgG2/leaeHnAu f80uFrH3uN03r+vQzmn1po0JOvzzx85TZAMVqFLVKJaBWR7IlOxtcW7t7q54vogc1P/E mTryAPUrNxXjoK6p0FlhzKOgNnYPuWNYgLkfqKq+KjOc8USqnAv4BoAvx8HLARCuQVTE XBevLBCIgquPwYZYjTuYKS4FBdhbKLqpxsGn9g7RNuVZHgvxRhbSwdPEYT9iPbSLvthX qcpcA/Z2MZFMMSZ5lcwoKWKn3E5kNiynqB7/O5xKYlt+6hq4G3TujzkIFPaMGQ6OsVnW uNYg== 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=vRvCBy0lOfTmbT+5XS73GokI8KbMBzcXHSleSL/eF68=; b=WFkmcNnN1IMtTrMRB32gJPbXE9Lkg/GbN7EbGyh5kGhrdhCi3KjJnuRJUskIrAV/9m pgL/NyI1zva2ziaOxGmcgWxJjN04Qp74J9Zs62Ilj0sK4ZlD1k9mFR/0A2O/aY/7d+1F GSeelQBL72yqb714uOOAqVSyhfCWppbNI3Qsj6cXWSwHD2Sh/mNyUNCZZ0HQaPg2k8Dc HQ8qTDUORy+v5PLcb9heAnmcpXGezXk/dbj/RrQ/F+nUHRtJgKDZoLzvdGTVYExxc66f FCotUxzPl/OxOUY5tPba8xa+Bi/CnL22JOuXyR61lJ+Das3HSI0d+WqE6sl/1HW6t4cX mq/w== X-Gm-Message-State: ALQs6tCAa2npWXJiPuhqTIJBuJPxZxx2yNL4/PJn4XB07vWHas/DBpQW YIirYKEXYrDjM6C1hrPcCwU= X-Google-Smtp-Source: AIpwx49fLigJ0FOuLFmJ44yOjuJsjWUIpLX9SuRY9w86gjlSFjr7mqnO6kOjhVlkjKFBmKkIA+YptQ== X-Received: by 10.223.163.221 with SMTP id m29mr11837322wrb.4.1523901384546; Mon, 16 Apr 2018 10:56:24 -0700 (PDT) Received: from gentoo0.localdomain (x4e33bf85.dyn.telefonica.de. [78.51.191.133]) by smtp.gmail.com with ESMTPSA id w14sm8522414wmd.1.2018.04.16.10.56.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 10:56:23 -0700 (PDT) From: Kirill Marinushkin To: Mark Brown Date: Mon, 16 Apr 2018 19:56:44 +0200 Message-Id: <20180416175644.30081-1-k.marinushkin@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180416165206.GE20726@sirena.org.uk> References: <20180416165206.GE20726@sirena.org.uk> Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Pan Xiuli , Pierre-Louis Bossart , Liam Girdwood , Kirill Marinushkin Subject: [alsa-devel] [PATCH] ASoC: topology: Modify clock gating parameter parsing to switch 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 This improves the coding style of this piece of code. Signed-off-by: Kirill Marinushkin Cc: Mark Brown Cc: Pierre-Louis Bossart Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Pan Xiuli Cc: Liam Girdwood Cc: linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org --- sound/soc/soc-topology.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 04f834e6a6b5..802bad7ddcb4 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1982,11 +1982,19 @@ 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) + switch (hw_config->clock_gated) { + case 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) + break; + + case SND_SOC_TPLG_DAI_CLK_GATE_CONT: link->dai_fmt |= SND_SOC_DAIFMT_CONT; + break; + + default: + /* ignore the value */ + break; + } /* clock signal polarity */ invert_bclk = hw_config->invert_bclk;