From patchwork Tue Jun 30 10:25:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kimmo Saarela X-Patchwork-Id: 6695041 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 11AEC9F39B for ; Tue, 30 Jun 2015 10:27:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 329342055B for ; Tue, 30 Jun 2015 10:27:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 00D2D20532 for ; Tue, 30 Jun 2015 10:27:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0495F2605D6; Tue, 30 Jun 2015 12:27:43 +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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BC6222604CE; Tue, 30 Jun 2015 12:25:51 +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 D89C32604A4; Tue, 30 Jun 2015 12:25:48 +0200 (CEST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by alsa0.perex.cz (Postfix) with ESMTP id 62872260474 for ; Tue, 30 Jun 2015 12:25:41 +0200 (CEST) Received: by lagx9 with SMTP id x9so7427555lag.1 for ; Tue, 30 Jun 2015 03:25:41 -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 :in-reply-to:references; bh=3P3kejMXZPuzUTB857MRMM0hHspkYfnzyAdzOUzYvLw=; b=po/Su9N4fXMjkAPdk+xr3XXiFMZbohF0ShxQ9EcYT2irmJXzhXCCQSaIcaSHCRWCrR AAFu1pnlS9YGmCvmd5sjQQ+bhyAFBQhAY82UiwJEv1LvantRk2oiu9DMJVO6JVMQ9+sR 2pTYKIQ49fupbBaVUADaJ2Ft96oPYPqBza1PRiZaAjQYP86fUS8WgwOkaenIguDFbWYU xPa0x0ClHJ0sJOt46FJ3AJbPpQ7+zIlm+nKf/Py4a+1ViJAMn3sMzyA2QqBrZNvUd8bo 9L862m/1bFrhy3sbBjLIkHYJXuQ9DKrlXwFR6ljGYVbWNlmCDFW8yDczKLp9tSysjVPO VRdA== X-Received: by 10.152.6.132 with SMTP id b4mr16712895laa.53.1435659941155; Tue, 30 Jun 2015 03:25:41 -0700 (PDT) Received: from localhost.localdomain (85-76-111-162-nat.elisa-mobile.fi. [85.76.111.162]) by mx.google.com with ESMTPSA id bm5sm11553431lbc.45.2015.06.30.03.25.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jun 2015 03:25:40 -0700 (PDT) From: Kimmo Saarela To: Jaroslav Kysela , Takashi Iwai Date: Tue, 30 Jun 2015 13:25:11 +0300 Message-Id: <7007ae68aa1b5585ca791cedcf0527d1c918d2ce.1435569929.git.kimmo.saarela@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Cc: Kimmo Saarela , devicetree@vger.kernel.org, alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/5] ASoC: tlv320aic32x4: Move bit polarity config to specific switch statement 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 Move data format bit polarity control to its own switch statement, instead of magically selecting invert for specific formats. Fix supply format in binding documentation Signed-off-by: Kimmo Saarela --- .../devicetree/bindings/sound/tlv320aic32x4.txt | 2 +- sound/soc/codecs/tlv320aic32x4.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt b/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt index 5e2741a..143a192 100644 --- a/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt +++ b/Documentation/devicetree/bindings/sound/tlv320aic32x4.txt @@ -5,7 +5,7 @@ The tlv320aic32x4 serial control bus communicates through I2C protocols Required properties: - compatible: Should be "ti,tlv320aic32x4" - reg: I2C slave address - - supply-*: Required supply regulators are: + - *-supply: Required supply regulators are: "iov" - digital IO power supply "ldoin" - LDO power supply "dv" - Digital core power supply diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index ce0972f..d3636c1 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c @@ -353,17 +353,35 @@ static int aic32x4_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return -EINVAL; } + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { + case SND_SOC_DAIFMT_IB_NF: + iface_reg_3 |= (1 << 3); /* invert bit clock */ + break; + + case SND_SOC_DAIFMT_NB_IF: + break; + + case SND_SOC_DAIFMT_IB_IF: + iface_reg_3 |= (1 << 3); /* invert bit clock */ + break; + + case SND_SOC_DAIFMT_NB_NF: + break; + + default: + return -EINVAL; + } + + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_I2S: break; case SND_SOC_DAIFMT_DSP_A: iface_reg_1 |= (AIC32X4_DSP_MODE << AIC32X4_PLLJ_SHIFT); - iface_reg_3 |= (1 << 3); /* invert bit clock */ iface_reg_2 = 0x01; /* add offset 1 */ break; case SND_SOC_DAIFMT_DSP_B: iface_reg_1 |= (AIC32X4_DSP_MODE << AIC32X4_PLLJ_SHIFT); - iface_reg_3 |= (1 << 3); /* invert bit clock */ break; case SND_SOC_DAIFMT_RIGHT_J: iface_reg_1 |=