From patchwork Sun Jul 19 04:09:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 6821531 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 021689F1D4 for ; Sun, 19 Jul 2015 04:09:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 189EA20549 for ; Sun, 19 Jul 2015 04:09:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9AA9F20546 for ; Sun, 19 Jul 2015 04:09:40 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 37C2E26054D; Sun, 19 Jul 2015 06:09:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 307FA2604BC; Sun, 19 Jul 2015 06:09: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 CF0752604BD; Sun, 19 Jul 2015 06:09:29 +0200 (CEST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by alsa0.perex.cz (Postfix) with ESMTP id 989762604A6 for ; Sun, 19 Jul 2015 06:09:22 +0200 (CEST) Received: by pabkd10 with SMTP id kd10so10736549pab.2 for ; Sat, 18 Jul 2015 21:09:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=SRAlDSAqDHs2s56Smjip7dxpQJbFpKoKcvmXkRNBT4U=; b=ex3odfAI4cOnVHNFC3Nx/7a1bvEUuq4M3wO9hQMY0rS+ZPWo5A6ecr0qenuRtAoVa9 aZ1ES9TIuj/Y8pRApHHnggzcXzJFl1deD4J3VZhkKWFqn3L07diuKDBH7wIuqm99Hzh2 IQs0fPKpyzjY+vY2K6B6dtgxOFmvwJK9M++4wEKBR6E8hhp1K06lIP17nD+bHttELJHH 1Z6y1dC67eFYyYmraSO3yVAxMSnJaNTptBDiulMy/s6AflRp8FEZjcgWT+teKCcq0ZrF RXXW1/UX4b4X5U70fUD9s+CxjccCBJzYLgr6ViRcO5QA2gEJIK8Dd9rcewVVqS7CEmlV dxMw== X-Gm-Message-State: ALoCoQnb3QQBibWpGR3ltXPkWHB0IgGaBroteKLutZktxSSrmeUFwzF0gByOxBnXFafnXhwZPB9t X-Received: by 10.68.141.232 with SMTP id rr8mr44133297pbb.7.1437278961083; Sat, 18 Jul 2015 21:09:21 -0700 (PDT) Received: from phoenix.local (118-171-143-53.dynamic.hinet.net. [118.171.143.53]) by smtp.gmail.com with ESMTPSA id so5sm15797220pab.37.2015.07.18.21.09.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jul 2015 21:09:20 -0700 (PDT) Message-ID: <1437278956.20103.1.camel@ingics.com> From: Axel Lin To: Mark Brown Date: Sun, 19 Jul 2015 12:09:16 +0800 X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Cc: Brian Austin , alsa-devel@alsa-project.org, Liam Girdwood , Paul Handrigan Subject: [alsa-devel] [PATCH RFT] ASoC: cs4265: Fix setting dai format for Left/Right Justified 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The settings in current code does not match the datasheet, fix it. DAC Control - Address 03h DAC Digital Interface Format (Bits 5:4) DAC_DIF1 DAC_DIF0 Description 0 0 Left Justified, up to 24-bit data (default) 0 1 I²S, up to 24-bit data 1 0 Right-Justified, 16-bit Data 1 1 Right-Justified, 24-bit Data Transmitter Control 2 - Address 12h Transmitter Digital Interface Format (Bits 7:6) Tx_DIF1 Tx_DIF0 Description Format Figure 0 0 Left Justified, up to 24-bit data (default) 0 1 I²S, up to 24-bit data 1 0 Right-Justified, 16-bit Data 1 1 Right-Justified, 24-bit Data Signed-off-by: Axel Lin --- Hi, I don't have the h/w to test, so please test if this patch works. Thanks, Axel sound/soc/codecs/cs4265.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index d1a77c7..e42a5038 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -457,14 +457,14 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_RIGHT_J: if (params_width(params) == 16) { snd_soc_update_bits(codec, CS4265_DAC_CTL, - CS4265_DAC_CTL_DIF, (1 << 5)); + CS4265_DAC_CTL_DIF, (2 << 4)); snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, - CS4265_SPDIF_CTL2_DIF, (1 << 7)); + CS4265_SPDIF_CTL2_DIF, (2 << 6)); } else { snd_soc_update_bits(codec, CS4265_DAC_CTL, - CS4265_DAC_CTL_DIF, (3 << 5)); + CS4265_DAC_CTL_DIF, (3 << 4)); snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, - CS4265_SPDIF_CTL2_DIF, (1 << 7)); + CS4265_SPDIF_CTL2_DIF, (3 << 6)); } break; case SND_SOC_DAIFMT_LEFT_J: @@ -473,7 +473,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, snd_soc_update_bits(codec, CS4265_ADC_CTL, CS4265_ADC_DIF, 0); snd_soc_update_bits(codec, CS4265_SPDIF_CTL2, - CS4265_SPDIF_CTL2_DIF, (1 << 6)); + CS4265_SPDIF_CTL2_DIF, 0); break; default: