From patchwork Tue Jul 19 22:36:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9238391 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 53B4E602F0 for ; Tue, 19 Jul 2016 22:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 438E22624C for ; Tue, 19 Jul 2016 22:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 38528277D9; Tue, 19 Jul 2016 22: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 7BA722624C for ; Tue, 19 Jul 2016 22:36:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 446F82663DF; Wed, 20 Jul 2016 00:36:42 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 76F42265960; Wed, 20 Jul 2016 00:36:11 +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 C074D265969; Wed, 20 Jul 2016 00:36:10 +0200 (CEST) Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by alsa0.perex.cz (Postfix) with ESMTP id C0E9226584E for ; Wed, 20 Jul 2016 00:36:04 +0200 (CEST) Received: by mail-pa0-f68.google.com with SMTP id cf3so2040771pad.2 for ; Tue, 19 Jul 2016 15:36:04 -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:in-reply-to:references; bh=gm1A1OeHmDViYAqwiR2LqiyBV+vkitUtJVgikoqE3ds=; b=O/DWieN9D1EkWUd8sUW5hBHa/0x/Adzx2IjKgTWMdZNqm1xZghQ4v/SZMQhlGvvVqp BYjF4hGDDRufqWw5ThzN3IfTeHAoj47fyg+aYfUSlWvTcJF8XbStOPAJMa/7cEwmCbV0 CZY3Ft+lTFGdxWIZvjxu5JI9d3q//JAyc4x+TdL2jskR55OuMQeZIzovyJvVdHNODWzG 2Y0qMHC8JWM919GGrtyH/QMnV6oGlpDQqbUnMUv55JbCDS633PBjPoFZMAFTllzb7yEN 7UAyb903MczwTt5JaDUzLuA6a9l67eG2Ni4L16w5g7bURCUJFlvCEE/NmHAxaYj6xfKK kglQ== 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:in-reply-to :references; bh=gm1A1OeHmDViYAqwiR2LqiyBV+vkitUtJVgikoqE3ds=; b=PmwQzLVBHnpCUmTVc1yJYZ5MPhosTkFhoBRdjEUFzL+LFA6vxMgDK/yf1CsUt4prIn Rz+bLbMQMLfNNYMRT2Pbousijvpas6q8m/ooIwt0MXQPUvWvuDL8KNK8TvyGIRGbIJbp NaGkXOETu/AdYxFWmPtXxtl2ZlDo9TlKnIVFZG5QlyqhOsjsUwAfjCaifK/6xB1XUzO1 gf1Up6cX4pn9R3U8an55/wB1fHcIjha+7l8Tc9kLCMAjo/X1d41bzfkgFpNNvMRBbyec 13MMhK6hknFyJG4usldksdw1LchmBP9VeZGRE0lEn1/CShFk7oiQa+TkRnj/WDw9M4NF kcpA== X-Gm-Message-State: ALyK8tKEy5amj9dssn81bnCazRR9kFbH2rkxm5eA+ZflWMo3tp+VFFTmNNohH7D2eCbLfQ== X-Received: by 10.66.124.136 with SMTP id mi8mr8136175pab.26.1468967763976; Tue, 19 Jul 2016 15:36:03 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id j7sm7503094paa.30.2016.07.19.15.36.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 15:36:03 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Tue, 19 Jul 2016 15:36:14 -0700 Message-Id: <1468967774-18621-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468967774-18621-1-git-send-email-nicoleotsuka@gmail.com> References: <1468967774-18621-1-git-send-email-nicoleotsuka@gmail.com> 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 2/2] ASoC: cs53l30: Fix bit shift issue of TDM mode 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 The TDM mode using PCM format now has two-bit right shift due to the format configuration in the driver. According to Figure 4-13 in the CS53L30 datasheet, using ASP_SCLK_INV = 0 and SHIFT_LEFT = 1 should be the correct combination to create one-bit right shift for the DSP type A format. Signed-off-by: Nicolin Chen --- sound/soc/codecs/cs53l30.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index fd5502e..2c0d9c4 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -592,8 +592,12 @@ static int cs53l30_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) aspctl1 |= CS53L30_ASP_TDM_PDN; break; case SND_SOC_DAIFMT_DSP_A: - /* Clear TDM_PDN and SHIFT_LEFT, invert SCLK */ - aspcfg |= CS53L30_ASP_SCLK_INV; + /* + * Clear TDM_PDN to turn on TDM mode; Use ASP_SCLK_INV = 0 + * with SHIFT_LEFT = 1 combination as Figure 4-13 shows in + * the CS53L30 datasheet + */ + aspctl1 |= CS53L30_SHIFT_LEFT; break; default: return -EINVAL;