Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4361938ybl; Tue, 20 Aug 2019 10:43:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKnKKgSsL/4Vo8w7+ippbGTnebk7CoUFK27XGesbehs5TzQe+EHZA9Rji02mWyeyWC6HEu X-Received: by 2002:a62:65c7:: with SMTP id z190mr22600962pfb.9.1566323019750; Tue, 20 Aug 2019 10:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566323019; cv=none; d=google.com; s=arc-20160816; b=LVu8PLlrXUY9oQrdS1aIuYkQAw78zAHVH7AMiTGTsUwv57Az88+3H5Ze+V0LI2vdzy C2IIhpyzjUS0RMKxpaHKITKj0YOzhvlE9BYXVr7ougYLzckHXHPc67FG3Aei7W94Zdk8 uTdqKzIzziICSZzKaUceh9w9oqGOS4UlJ7tsDwTW/7iqS3p+YtyYakX5vfKUcYfa16Ev p6RmNNrUuSyYoYEF5rNydS7Yz+fHSr0TqZNV5058+P6V489Q/scIioZZQqTMcrvhyzF2 +3dNEc50ifqtIjK0T6jtiMyTXB8k9kq2qLgAQF1TTdjK01o5ko3xgDpyXe82124bHgkL 70Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from; bh=Ykr2ti2nWYJlvFYvrUQQ3egoqvPPKK3gISVOAT9VfWc=; b=qEBLnhhcdt28bXNlkjE+PhboMTE4VWnCKlpJtJw1boJWgpMGO+yZarIMVolMPzqHJ4 kAwggDRCVTv+vUZUBpMPGbiwEtUGfmz6t4stEO1YlBrif04ZtxXIjAhkj0p+zMmULb6O EWsJC4rc0l3IWw8slb1M0XuIkO0XjTx9B5mGk6Uv3HIHgOnGXXjL5tqWWQXrRQy8NAhA eH10WlFmLU1cfTNZ0n7Pk7JY4fg7aHSEs6HNC8qUxubZfEzCJr6mhOSiPOzKCLWgiang 7YsTbAEgytceoph9e6P9qaSx/YdzlnHPksAlG+OM8GsW50H3Lc1Hmk0REMrCUm/+wcFJ Sapw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si12431861pgp.78.2019.08.20.10.43.24; Tue, 20 Aug 2019 10:43:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730845AbfHTRmF (ORCPT + 99 others); Tue, 20 Aug 2019 13:42:05 -0400 Received: from mail-wr1-f99.google.com ([209.85.221.99]:41216 "EHLO mail-wr1-f99.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730233AbfHTRlH (ORCPT ); Tue, 20 Aug 2019 13:41:07 -0400 Received: by mail-wr1-f99.google.com with SMTP id j16so13258421wrr.8 for ; Tue, 20 Aug 2019 10:41:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:message-id:date; bh=Ykr2ti2nWYJlvFYvrUQQ3egoqvPPKK3gISVOAT9VfWc=; b=AWXAYTZm0R1iI1DRAnhIW2ldoPHH2RLqvttEBto3cPMw4lqb5IP+gRrXkZQ/DPS43i vR69+iWs/7RUIvtQQLxQXIEfHgk2brKom1khgYfJ3+U6s9O/2vcEKNU5LcV50H4BK1iR 5Xf0kKw6TTmrR9l4quQrWNHVlwTJMegRpglsyBQK+T722VHt6ASqr0IyLw0fJH48wqws MPOFnR0tYZ+q+sSvh8C3SP2MkBB8hjj083aFGlT1ffFMA32GTt3j05hpLt6L6WaHTXN9 mSa1IycGoo11Bd7iulOfWDAtWXCsjZPXALhEVq6lgwRVScAvu2x4cg1rUiYl62E6Sqjz 3QeQ== X-Gm-Message-State: APjAAAVelEQNAeTDu0tT7gyi27GzbXzYf1UkdJB0BL990t0lxayIquL0 Z9VcwSAD7YIkKGf6k1vHU12vd9Hc+I59v02z5IA3AdaXcNZaQjYY58Udujpzda6UVA== X-Received: by 2002:adf:fe12:: with SMTP id n18mr35700959wrr.105.1566322865868; Tue, 20 Aug 2019 10:41:05 -0700 (PDT) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk. [2a01:7e01::f03c:91ff:fed4:a3b6]) by smtp-relay.gmail.com with ESMTPS id h25sm2328wmb.21.2019.08.20.10.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 10:41:05 -0700 (PDT) X-Relaying-Domain: sirena.org.uk Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i0881-00032g-Ju; Tue, 20 Aug 2019 17:41:05 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id F371F2742B4A; Tue, 20 Aug 2019 18:41:04 +0100 (BST) From: Mark Brown To: Maxime Ripard Cc: alsa-devel@alsa-project.org, broonie@kernel.org, Chen-Yu Tsai , codekipper@gmail.com, lgirdwood@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown , Maxime Ripard Subject: Applied "ASoC: sun4i-i2s: Fix the LRCK polarity" to the asoc tree In-Reply-To: X-Patchwork-Hint: ignore Message-Id: <20190820174104.F371F2742B4A@ypsilon.sirena.org.uk> Date: Tue, 20 Aug 2019 18:41:04 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: sun4i-i2s: Fix the LRCK polarity has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From dd657eae8164f7e4bafe8b875031a7c6c50646a9 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Mon, 19 Aug 2019 21:25:20 +0200 Subject: [PATCH] ASoC: sun4i-i2s: Fix the LRCK polarity The LRCK polarity "normal" polarity in the I2S/TDM specs and in the Allwinner datasheet are not the same. In the case where the i2s controller is being used as the LRCK master, it's pretty clear when looked at under a scope. Let's fix this, and add a comment to clear up as much the confusion as possible. Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3") Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/e03fb6b2a916223070b9f18405b0ef117a452ff4.1566242458.git-series.maxime.ripard@bootlin.com Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-i2s.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index e3eadfe38aaf..29b5eacd3abe 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -570,23 +570,29 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, u32 mode, val; u8 offset; - /* DAI clock polarity */ + /* + * DAI clock polarity + * + * The setup for LRCK contradicts the datasheet, but under a + * scope it's clear that the LRCK polarity is reversed + * compared to the expected polarity on the bus. + */ switch (fmt & SND_SOC_DAIFMT_INV_MASK) { case SND_SOC_DAIFMT_IB_IF: /* Invert both clocks */ - val = SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED | - SUN8I_I2S_FMT0_LRCLK_POLARITY_INVERTED; + val = SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED; break; case SND_SOC_DAIFMT_IB_NF: /* Invert bit clock */ - val = SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED; + val = SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED | + SUN8I_I2S_FMT0_LRCLK_POLARITY_INVERTED; break; case SND_SOC_DAIFMT_NB_IF: /* Invert frame clock */ - val = SUN8I_I2S_FMT0_LRCLK_POLARITY_INVERTED; + val = 0; break; case SND_SOC_DAIFMT_NB_NF: - val = 0; + val = SUN8I_I2S_FMT0_LRCLK_POLARITY_INVERTED; break; default: return -EINVAL; -- 2.20.1