From patchwork Wed Jun 8 23:10:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9165907 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 79CA36088F for ; Wed, 8 Jun 2016 23:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A0042830C for ; Wed, 8 Jun 2016 23:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D1B52831B; Wed, 8 Jun 2016 23:11:00 +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 861D92830C for ; Wed, 8 Jun 2016 23:10:59 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 72796266549; Thu, 9 Jun 2016 01:10:58 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9FFD22666DD; Thu, 9 Jun 2016 01:10:30 +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 7124E2666B9; Thu, 9 Jun 2016 01:10:27 +0200 (CEST) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by alsa0.perex.cz (Postfix) with ESMTP id 7C95026668E for ; Thu, 9 Jun 2016 01:10:00 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id c74so1451953pfb.0 for ; Wed, 08 Jun 2016 16:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/OcZeQ+f9vDhHsQZFG7aw09zNZc5fZAAhRwU9838tMk=; b=KxCI08cJr/Id67DZrkQ/zNrATy2iVCyk2GwxXK3TpTeKNTCmKPpy6LvyjioQIJt0kW VGvWceHDLFnBAoxyyYITF5ibcK8lXXlprhfen86JeEKDXV7NLPRFAtp5RTk23Fyw1Fci AdYQFf8U6oxeKMAOlhRoRQ6+UTuiaIkcgfnJlWnskZAA94JaJLE5BzQKLHtaJaYpKcL9 d6GeyPirhGsZILaqjYw5hdIhc7QhV1kAxxsCZN7kuveaiCJj+q3KHXG1Eg31N6hMYSO4 q5QcZdYBUjZlpu/ncoXjsgIe/yOzC8j/r3/pmDe8UnPP0pAw7rtCp6HY5+MpryTB+N1q EXLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/OcZeQ+f9vDhHsQZFG7aw09zNZc5fZAAhRwU9838tMk=; b=AAk0k5Khn2taXaxCNPjcv6wS+3te6QQa9KsVY14po5fgZmEfuW22twXd9QPCzOmJbT ExHu6JZvAwpnlwkT0PfdB0zpnFyC2XmYeDez61/lnL1+a39T5c8ZH/MLB4mb43d+o5wx h2Za3Pj/fG6Se3KNcoAkx3M2fdjGAM/G9MhfQsmT7n7JSU4Saldqd03gXk0fCAUudv5b 3PgJmyBF4NYG/9UaUibG0SRVEE7EnISCs71TgaPqBJvqYlTeA53/uoScUOwcpM5Em+SC PTHsNnqWQX7NIItoJhe/+n4FA/9ERzhP3ZC4LHIq170slcvn/RrgX8MHr0l25Y00Kwku qHig== X-Gm-Message-State: ALyK8tIZKQaQwqwgoIapGj3r8OgTSc6G1knrQrlnEza0lTFuancAvZjdf/UU6+CcqiSv3A== X-Received: by 10.98.24.70 with SMTP id 67mr1034318pfy.52.1465427399658; Wed, 08 Jun 2016 16:09:59 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id hw10sm4820566pac.15.2016.06.08.16.09.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 16:09:59 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Wed, 8 Jun 2016 16:10:05 -0700 Message-Id: <1465427405-11344-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: brian.austin@cirrus.com, alsa-devel@alsa-project.org, lgirdwood@gmail.com, Paul.Handrigan@cirrus.com, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v2] ASoC: cs53l30: Correct clock inversion check 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 SND_SOC_DAIFMT_IB_NF = 0x3 (11b) | SND_SOC_DAIFMT_IB_IF = 0x4 (100b) creates a mask 0x7 (111b) which also includes SND_SOC_DAIFMT_NB_IF = 0x2 (10b). So this patch uses the traditional way to check the clock inversion. Signed-off-by: Nicolin Chen --- Changelog: v1->v2: * Correct one typo in the commit log sound/soc/codecs/cs53l30.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index ac90dd7..62daa0c 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -598,8 +598,14 @@ static int cs53l30_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) } /* Check to see if the SCLK is inverted */ - if (fmt & (SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_IB_IF)) + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { + case SND_SOC_DAIFMT_IB_NF: + case SND_SOC_DAIFMT_IB_IF: aspcfg ^= CS53L30_ASP_SCLK_INV; + break; + default: + break; + } regmap_update_bits(priv->regmap, CS53L30_ASPCFG_CTL, CS53L30_ASP_MS | CS53L30_ASP_SCLK_INV, aspcfg);