Received: by 10.192.165.156 with SMTP id m28csp928660imm; Mon, 16 Apr 2018 10:57:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx48gqbtPg5/yWY2o5eKrH79LnZffDwVHNfc1xaPK/N5uVY2600hjLwGabYId7Dom6Dw7gKVS X-Received: by 10.99.173.7 with SMTP id g7mr13480789pgf.170.1523901478069; Mon, 16 Apr 2018 10:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523901478; cv=none; d=google.com; s=arc-20160816; b=h/eUfSrGJXbW880PYqLi3tQwbVLaHQaOnnaa5kacF7c+z0+ODcwT4rVUgoSa3XFq/m lGLejOSWOAkTN7mqpj4fENvKUAU5XOMesubk5V7nRQSPBv8kzZn3utWN3DT0JL5xBQMr Y76PW1NJElngOW8P5+7Pr69/CoiSPJRbbsDEWVuaTzgumvixEnQdb9X+/KGmmQPyfMRa 28ZjNTBxabSdIymZC5yxO+s1iXy+eiQLPVZu6GMWMZl3C3uT5g6DuyrV603llegk98T6 7p75/CflDtnWYAXVzZ9zVrbQLA2jOQHuBuWx86YEMfsFma9IzHvRPuW6IV8Gv83vEkDi FaTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=vRvCBy0lOfTmbT+5XS73GokI8KbMBzcXHSleSL/eF68=; b=a42a0JhOB+K2UnHUox14Qywn32qrS3GyQ8NHf0pTOA+In2QOl/Uf94xs/2nRkSR5PR dCBr6GZBzuYNazotHbz//wLzWXBg7nGMaRnGGKMplDS3XolLgG2FcHzTan13MpwQMcpp fAUgJz5yq8/0dKMmZVh2h0AsGCKZsHZ0RsZj5Odb2EypyNzvJeeohZBS3tEgJ9AdjzPu ZNQzml3CkmXDkUFbYHMPFP+5aFUYy7TMVwHNbq8Hdsn9v4rfDJE1aD3+l1bKYjr05kId DvCs5+DsMtEpIYgIANJNm3JFNjMKe125bmjbQ/1ZKDdGTVne9K99v0nW6a1dfT2dsweC ID7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CFtEX0A1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a189si10140254pgc.586.2018.04.16.10.57.43; Mon, 16 Apr 2018 10:57:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CFtEX0A1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154AbeDPR43 (ORCPT + 99 others); Mon, 16 Apr 2018 13:56:29 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44012 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753118AbeDPR41 (ORCPT ); Mon, 16 Apr 2018 13:56:27 -0400 Received: by mail-wr0-f196.google.com with SMTP id y7so28435774wrh.10 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=efiDAY12G5Zl7rioDEO9A23A3OpJmvfUPo0bd7ltMoCK4jYi4NYVThqpKyWCKy9Rjs kKN2kjL+Ny9kq6adeEWkrCYuLI5poPa1EQ9rkb4IspVuyW3DsgaCcQ/X9opCPmFWgX2G Ysa9DyLDDxdr7xjNeko2bEAB+kiHv4LWT4tX9d2ZC/P5sVsrFub2YntUXaR8l7Tk3FkY iPn15swGkDZWEjE3UiVbk7jT8weXfex6vJngZ1ixj3qRy1qhZLDLLT9M9T9Ax2tdAzGv 1EUUd1VdRn1KxGU0jNKOBMgPThrchII9kztCbhW2bDBGik2gxPx/F2QTrhIpl6TfAGYt 4EyQ== X-Gm-Message-State: ALQs6tAp+EZes6hff6hcTWCiv2r010TRrzhc3BW7hAwxNP7K+QV0CrJr QfgdD27qlgDinMmr4aB8bAU= 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 Cc: Kirill Marinushkin , Pierre-Louis Bossart , Jaroslav Kysela , Takashi Iwai , Pan Xiuli , Liam Girdwood , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH] ASoC: topology: Modify clock gating parameter parsing to switch 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.13.6