From patchwork Mon Feb 26 03:12:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yong X-Patchwork-Id: 10241199 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 D83ED60386 for ; Mon, 26 Feb 2018 03:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9BB729E93 for ; Mon, 26 Feb 2018 03:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC7C229E96; Mon, 26 Feb 2018 03:14:38 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 4A97D29E93 for ; Mon, 26 Feb 2018 03:14:37 +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:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=RBRVRyRtx2fLqJXFxa8g1z5fjIgK/LSNghYdPYYYmWU=; b=s9f AvfgOdF7vvPRC7EiIN+s/CK1TOmobqS0Hz608efd6RigF0ZnepOTXUZpKLr5tlDJn+sk9PP52qHBW d8+Sz0PwTupI4ozLVKPYk1E4qJlCg0D+0eepsrnjVyfXN/vSEmxqGmS9SZnfZslGrngzM/QXJOk60 kwXartLadARVBOg9A9jxodLjcp2nbpdvXODdOuS17bqtfcWe8+JJA/KghNMYUchKELiehTm4C44D4 ueMQ7Zy6t9bAwhJ9/4X2ohmSZ5QklAJ4TDllgx4v0D9bbdV36Pko/s08Qic7nqiLwo1Izf+XLTjIH wzT2pGQ59KlBfmbe0OB6e7hxixaUPoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eq9FD-0007CO-Ab; Mon, 26 Feb 2018 03:14:27 +0000 Received: from out20-110.mail.aliyun.com ([115.124.20.110]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eq9F7-0007AX-CO for linux-arm-kernel@lists.infradead.org; Mon, 26 Feb 2018 03:14:24 +0000 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.260804|-1; CH=green; FP=0|0|0|0|0|-1|-1|-1; HT=e01e04486; MF=yong.deng@magewell.com; NM=1; PH=DS; RN=13; RT=13; SR=0; TI=SMTPD_---.B5B-1F2_1519614839; Received: from linuxproject.localdomain(mailfrom:yong.deng@magewell.com fp:58.213.29.2) by smtp.aliyun-inc.com(10.147.40.26); Mon, 26 Feb 2018 11:14:00 +0800 From: Yong Deng To: Maxime Ripard Subject: [PATCH] ASoC: sun4i-i2s: Fix offset tune for SUN8I Date: Mon, 26 Feb 2018 11:12:18 +0800 Message-Id: <1519614738-10959-1-git-send-email-yong.deng@magewell.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180225_191421_625621_9C3ED6DF X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. 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, Yong Deng , linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Takashi Iwai , Liam Girdwood , Marcus Cooper , Chen-Yu Tsai , Mark Brown , Philipp Zabel , Jaroslav Kysela , 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 SUN8I_I2S_TX_CHAN_OFFSET_MASK should be GENMASK(13, 12). And offset tune of RX should also be updated. Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3") Signed-off-by: Yong Deng --- sound/soc/sunxi/sun4i-i2s.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index a4aa931ebfae..797cafffaac8 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -110,12 +110,15 @@ #define SUN8I_I2S_TX_CHAN_MAP_REG 0x44 #define SUN8I_I2S_TX_CHAN_SEL_REG 0x34 -#define SUN8I_I2S_TX_CHAN_OFFSET_MASK GENMASK(13, 11) +#define SUN8I_I2S_TX_CHAN_OFFSET_MASK GENMASK(13, 12) #define SUN8I_I2S_TX_CHAN_OFFSET(offset) (offset << 12) #define SUN8I_I2S_TX_CHAN_EN_MASK GENMASK(11, 4) #define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1) << 4) #define SUN8I_I2S_RX_CHAN_SEL_REG 0x54 +#define SUN8I_I2S_RX_CHAN_OFFSET_MASK GENMASK(13, 12) +#define SUN8I_I2S_RX_CHAN_OFFSET(offset) (offset << 12) + #define SUN8I_I2S_RX_CHAN_MAP_REG 0x58 /** @@ -460,6 +463,9 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) regmap_update_bits(i2s->regmap, SUN8I_I2S_TX_CHAN_SEL_REG, SUN8I_I2S_TX_CHAN_OFFSET_MASK, SUN8I_I2S_TX_CHAN_OFFSET(offset)); + regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG, + SUN8I_I2S_RX_CHAN_OFFSET_MASK, + SUN8I_I2S_RX_CHAN_OFFSET(offset)); } regmap_field_write(i2s->field_fmt_mode, val);