From patchwork Wed Jun 8 23:03:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9165897 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 814E4604DB for ; Wed, 8 Jun 2016 23:03:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72D68281F9 for ; Wed, 8 Jun 2016 23:03:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67AB728310; Wed, 8 Jun 2016 23:03:26 +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 82E47281F9 for ; Wed, 8 Jun 2016 23:03:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 40491266267; Thu, 9 Jun 2016 01:03:23 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 13E352654D0; Thu, 9 Jun 2016 01:03:16 +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 31E9226574C; Thu, 9 Jun 2016 01:03:14 +0200 (CEST) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by alsa0.perex.cz (Postfix) with ESMTP id 0F542261687 for ; Thu, 9 Jun 2016 01:03:07 +0200 (CEST) Received: by mail-pf0-f195.google.com with SMTP id c74so1442991pfb.0 for ; Wed, 08 Jun 2016 16:03:06 -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=fknyraiTqldrPafm9xYmiLl3YqJpcJ7+BFUu5zyLvD0=; b=txol+YEFca6XvCsO3/urQqjgc6rM4np2jkmWo3hmeai6lX0bdNI+tE8Ipy5AMa8Q7B 4hdeaa9noLmheeSI38JUx0yjrDvwDYltmXjm5gq+nhiwzRS/lLvP79bLZAVrvYC64N74 i5wkxRrTN3YV33t6Rgv7rVO45CQYgY9pEIkmmG8pQYOLBkdadVNpwDI2BuOr28pxVHYy F7UKMT5OcN1qTAtgR987UK6UZiAXwz5kK8cPLLC6N/AZ5bmxbxWfjYkcFle9uJl8oxQp EJ/FP6HrFSSj0Zph42tJau+zVYHCODlTumVnn0TcnVQnxGZcYJPLih5mxnj0hESN8V// aaWg== 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=fknyraiTqldrPafm9xYmiLl3YqJpcJ7+BFUu5zyLvD0=; b=cwEodwMh9br6KZdcwpRvz0UlVSuvXPoq1HZygF66I7oNhqESKh1gsBhhKbQB7Pq8cn xNWg29rgHjwZ7AwRqdytrD1TvJvFEj2sS0x7THOMZciNdY94cscHASARYoerCiFhQOJY r+yIoYynULCXJtEv9GTzW1oCaZ5ftLYAhcNw6jSI+m8c6meAEYfSRzxAeMUvzsgteRo4 CqsqOnbxSPn/F1DJGj2ctbObpxWOr874j3Rar56i7q85uSRq23ynZGCD3eg2Ugje6fig pptWl4YnJM80Y9DKPOYsD7SJYzcLRO/PDg6keCDeC9vuUz3RoNm5euUXx8YJsMt5Dnt1 pqCQ== X-Gm-Message-State: ALyK8tKBLLuePDSDyb1lqRaz+L7o5loSbXcWhp8vWmpAKJCCaCWz8/7TvzxWLmt2Nwvhtw== X-Received: by 10.98.102.25 with SMTP id a25mr1000745pfc.30.1465426985366; Wed, 08 Jun 2016 16:03:05 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id o1sm4782851pax.24.2016.06.08.16.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 16:03:04 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Wed, 8 Jun 2016 16:03:00 -0700 Message-Id: <1465426980-10924-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] 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_IB_NF = 0x2 (10b). So this patch uses the traditional way to check the clock inversion. Signed-off-by: Nicolin Chen --- 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);