From patchwork Thu Nov 9 17:44:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10051599 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 689E4603FA for ; Thu, 9 Nov 2017 17:46:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50E192AE86 for ; Thu, 9 Nov 2017 17:46:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44F182AE84; Thu, 9 Nov 2017 17:46:42 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8AA22AE84 for ; Thu, 9 Nov 2017 17:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Date:Message-Id: In-Reply-To:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: References:List-Owner; bh=33IR7NYi2hn86w0010ftdBRgmIeVp5GOmKnhxedRV5U=; b=sJU caWjKvAJ6pzX7ml4dikSwgunghqcj1+EdEE222l8/6y7G7GlbJJcVK9umdP7r9IWjsW+X5uTXkDPO WS1eNwStPe4/ZFAbh4uHjE1ee/XGyzr5SysAXYK+UajMlVocSzREtTN3Fb86BJXdkNs8J2V90ObcD szsgK3nRY1b7/0H5asikvVlNk1wmaPYfe7ydEjRjXsmVQQUWOYhhYYl+jsabobixwcmVMC0NBTLpt g9tgwtyLGwFWoo8yRY2+HEGQGCGau8FhimxYSakKp8HUhC15yIn/U5woWfYRweOtUdrX8j4n8+VGq QgTWbeCjluzehRNxysm9zR2gk6XNQNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eCquV-0001bz-S3; Thu, 09 Nov 2017 17:46:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eCqtZ-0000qa-1x for linux-arm-kernel@bombadil.infradead.org; Thu, 09 Nov 2017 17:45:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Date:Message-Id:In-Reply-To:Subject:Cc: To:From:Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kQ+SkaXFi6fYMR/0FuPgdE0AQw4CnAoMSL84AeI7YzQ=; b=UyyjplleJYGPh0xKirMvyuVWhy u3o1F13M+HDOiT7HSDrfLW/OywiXD1rUJE9yixl7SThCjI+Q4/bbE6BFEntap95F2TGd8PEzGOn1n H4diQKViVscksNsqalx6RR8CnDu6NSTsgwF6f9PdEofgMT46cbWDVtilRyolDekO+CEdeBPiP8rjG gvVwwMzGTq+YYywcLnbM1X2H8x7/dEQa5z1JzniBLsmMC8ALTdD2gA/ChrJ9bGFOoxZPc7YN7hwiV magV+IWI++gNErDKjjUscoQ7pcQXJ7nBKOeiFRfgzv4pBZiTL8VaWga0f9KAvdJrf5gNxQDmefYnm 3+WikNtw==; Received: from heliosphere.sirena.org.uk ([2a01:7e01::f03c:91ff:fed4:a3b6]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eCqtV-0008FP-MX for linux-arm-kernel@lists.infradead.org; Thu, 09 Nov 2017 17:45:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=kQ+SkaXFi6fYMR/0FuPgdE0AQw4CnAoMSL84AeI7YzQ=; b=UAXDLla5mDzg 5mfvH0OBngXaW58nfTAh5YAQ0/wZx+kxyLrWhrOn11JIcf0EOALA8AgBM5bad3yUhGB2BP0XoE0hl pzxC+jx/jSSOwTnda0G8JmoRGRaRSwTbgWb2WxKuiu4rMoHJ46mC0ZHhARAp96cm1RZNyaXwt55wT isEnU=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eCqsA-0005NB-Sb; Thu, 09 Nov 2017 17:44:14 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1eCqsA-0006j3-Fj; Thu, 09 Nov 2017 17:44:14 +0000 From: Mark Brown To: Maxime Ripard Subject: Applied "ASoC: sun8i-codec: Add a comment on the LRCK inversion" to the asoc tree In-Reply-To: <20171109094046.13483-1-maxime.ripard@free-electrons.com> Message-Id: Date: Thu, 09 Nov 2017 17:44:14 +0000 X-Bad-Reply: In-Reply-To but no 'Re:' in Subject. X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171109_174537_774394_882BD48A X-CRM114-Status: GOOD ( 20.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, Chen-Yu Tsai , broonie@kernel.org, Mylene Josserand , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: sun8i-codec: Add a comment on the LRCK inversion has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 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 e7b8a6d3efa8316dfe786e9cd559c62e9152337c Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 9 Nov 2017 10:40:46 +0100 Subject: [PATCH] ASoC: sun8i-codec: Add a comment on the LRCK inversion The current code might be a bit intriguing without having experienced the issue before, and might come up as a mistake. Make explicit what's going on by adding a comment. Signed-off-by: Maxime Ripard Signed-off-by: Mark Brown --- sound/soc/sunxi/sun8i-codec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index c2ceca485d6a..b3329692e3dc 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c @@ -197,6 +197,17 @@ static int sun8i_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, BIT(SUN8I_AIF1CLK_CTRL_AIF1_BCLK_INV), value << SUN8I_AIF1CLK_CTRL_AIF1_BCLK_INV); + + /* + * It appears that the DAI and the codec don't share the same + * polarity for the LRCK signal when they mean 'normal' and + * 'inverted' in the datasheet. + * + * Since the DAI here is our regular i2s driver that have been + * tested with way more codecs than just this one, it means + * that the codec probably gets it backward, and we have to + * invert the value here. + */ regmap_update_bits(scodec->regmap, SUN8I_AIF1CLK_CTRL, BIT(SUN8I_AIF1CLK_CTRL_AIF1_LRCK_INV), !value << SUN8I_AIF1CLK_CTRL_AIF1_LRCK_INV);