Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5252642ybl; Tue, 27 Aug 2019 01:37:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzWXUGXQuC+0oh102AaWZgRQ8wUqD+mSLDzd66d1o0jC4HBcap40vg9zoOVkQ3Dey7gA5N X-Received: by 2002:a17:90a:cc0e:: with SMTP id b14mr23569778pju.126.1566895025380; Tue, 27 Aug 2019 01:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566895025; cv=none; d=google.com; s=arc-20160816; b=qTOoG/bC1N2LQGsNoVf1wZDMgP9rQ28WFw9+gAbG54hu1k0vbpnRamoTNOid+ew/PJ ePayxHh4fjP6TLhP6pbrDBelMu2yL0UHdZLrusr9wtg5YwRRKg6oUP8l6RMdnaU44317 H406sheUjizovoOoPut8tN6GQiQI4T/gAb7nburjx5L4ENcuHEkYeUFhdO3k5ObH/Hat mGPZtCNKkGNjB3zAU4M1c+mRtPJlcHRWqB7NTAcNzpgg2FmzQ4ZaU0fex+IrGwvyPXTi m564TLCutvk66WVduRVzKZ+pt/qsjeW0CVwjfvOZo/vElN0Jl5FfbGQpypadLM/rmk9m JGyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CqjuZRe2ZHqHsJdWeZqP+8fdrbKikXqU+7SgwVIm4Ks=; b=q9IPEAD3PIpERSG7/aVG+Uda9ilsnr+XWlk7GZGpGliqwD3EnTdVhpMq+yH7YgofY0 oNkGA7At8LFwkOMYCjuj0B01lhDz8+GhUllGN5PCEW+b6W25NNyNBMiS1H163IGotjCx XfkoTMYATXepgNHCax8icjrmJs706FuvNeEh1P7ANyghIG1hbHH1MlrrA4vd3BVvv3rU o67OpsHR/85mL9RsK50Wnd8LwsisgiQ9HFRGfgUqLForS56hKWPZbBSg76cLJblGnmKk lEjGzgwIrl0LdS7eXzKm5FqeuYK/GHGtxysdhDRGEKLKMExlICe4UEJa/f4zAYeT4CgU pGIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lYPCOJDK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si10967427pgk.115.2019.08.27.01.36.50; Tue, 27 Aug 2019 01:37:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lYPCOJDK; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729726AbfH0IfT (ORCPT + 99 others); Tue, 27 Aug 2019 04:35:19 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41754 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbfH0IfT (ORCPT ); Tue, 27 Aug 2019 04:35:19 -0400 Received: by mail-lf1-f65.google.com with SMTP id j4so3598428lfh.8 for ; Tue, 27 Aug 2019 01:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CqjuZRe2ZHqHsJdWeZqP+8fdrbKikXqU+7SgwVIm4Ks=; b=lYPCOJDKkXkSeFkNMIIYgIDe/eZ/N8HPF89r80KL/bDAq25NzKHu2Wj3YR0+xNCt5i 8/fdGKL5aTh7wSi6fjwxYYJUDImGjW7nD7XstOqMcVwOjFgTqa2UIKr0Dj6hsR+aOwIq OwH8TLuxemD2cBSTb2GW/0vcrD1LGq/FzyNiilBtoJJJzRoj2+jot8AbgbORBmmwtl+T UjogiTBlMKC5mRpHCkViyluCGdU3WG4nKR5fhJVa6n8mJRjf2Hn1xqnYpOqgps0PT3wp AThiTMdx+0pYmUKdQCQSnV/nSvfAM8yeL9ZlDDEspY0Oif7ene2rllt08q/KW4rDPWEr rs+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CqjuZRe2ZHqHsJdWeZqP+8fdrbKikXqU+7SgwVIm4Ks=; b=c8asQL+qxIzvZru2S30GEwTuA4gevh29JpFcRxP6eGIWfF6yXvxn0mcNRrzGh4gDkl w8HqhlSfGNTn+pQc/d98KBCWoVYmDwllLm4O0XsXjz0TmIT6rvLmSxdElSAj3Ik8Sdtg 5oUwipsOyVYyoS/tRrBy1SipHS/yAjsB2AismcIbcu/C2n4Zf/90CO+mFTseTSmSSsYa X2PpqPe3VLHs13J7y18LHnLxc/FOY9EDme6CkfmgjQcsbvLkZPu+zjWXM7bfh2eM8R24 iRZeaz8iBfahrbCfibrAsHOwYo+K94f2iYbUS08i62KSiSRjnd1rioKPs3jrwj25s6+K yArQ== X-Gm-Message-State: APjAAAU7YTmANeoMvmYN3gw9hw0Q3p6OWNFzx/8g81oJmUQ33c+mwQPQ 1/Cak45rWAy2ulZ9I+zfMU77f0aQTN0HtiLZgsQOhw== X-Received: by 2002:a19:7401:: with SMTP id v1mr13798131lfe.155.1566894916059; Tue, 27 Aug 2019 01:35:16 -0700 (PDT) MIME-Version: 1.0 References: <20190826180734.15801-1-codekipper@gmail.com> <20190826180734.15801-2-codekipper@gmail.com> In-Reply-To: From: Code Kipper Date: Tue, 27 Aug 2019 10:35:04 +0200 Message-ID: Subject: Re: [linux-sunxi] [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T To: Chen-Yu Tsai Cc: Maxime Ripard , linux-sunxi , linux-arm-kernel , Liam Girdwood , Mark Brown , linux-kernel , Linux-ALSA , "Andrea Venturi (pers)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Aug 2019 at 10:01, Chen-Yu Tsai wrote: > > On Tue, Aug 27, 2019 at 1:55 PM Code Kipper wrote: > > > > On Tue, 27 Aug 2019 at 06:13, Chen-Yu Tsai wrote: > > > > > > On Tue, Aug 27, 2019 at 2:07 AM wrote: > > > > > > > > From: Marcus Cooper > > > > > > > > The regmap configuration is set up for the legacy block on the > > > > A83T whereas it uses the new block with a larger register map. > > > > > > Looking at the code Allwinner previously released [1], that doesn't seem to be > > > the case. Keep in mind that the register map shown in the user manual is for > > > the TDM interface, which we don't actually support right now. > > > > Should it matter what we support right now?, the block according to the user > > manual shows the bigger range. I don't have a A83T device and from what I > > There are a total of four I2S controllers on the A83T. Currently three of them > are listed in the dtsi file, which are _not_ the one shown in the user manual. > The one shown is the fourth one, which is the TDM controller. The configuration for the A83T suggests that it's a mixture of old and new which I don't think is the case considering it was released around the same time as the H3. There is enough similarity between the blocks for it to still work. For example on the H6 we referenced by mistake the H3 block and we still got audio (with only slight distortion). I would suggest to validate all of the i2s blocks we need to test using the internal loopback as that will also cover capture. > > It's not like we haven't seen this before. IIRC the A64 also had two variants > of the I2S interface. The one coupled with the audio codec was different from > the others. Yes...but the i2s of the audio codec was documented in the audio codec section. I've used this device to ensure that I've not broken anything in the old block with these new changes. > > > gather not many users do. But the compatible for the H3 has been removed > > and replaced with the settings for the A83T which also has default settings in > > registers further up than SUNXI_RXCHMAP. > > I'll sync up with Maxime on this. > > > > > > > The file shows the base address as 0x01c22800, and the last defined register > > > is SUNXI_RXCHMAP at 0x3c. > > > > > > The I2S driver [2] also shows that it is the old register map size, but with > > > TX_FIFO and INT_STA swapped around. This might mean that it would need a > > > separate regmap_config, as the read/write callbacks need to be changed to > > > fit the swapped registers. > > > > > > Finally, the TDM driver [3], which matches the TDM section in the manual, shows > > > a larger register map. > > > > > > A83T is SUN8IW6, while SUN8IW7 refers to the H3. > > > > Since when have we trusted Allwinner code?, the TDM labelled block > > clearly supports > > Since they haven't listed the I2S block in the user manual, so that is what we > have to go by. > > The TDM section in the user manual only lists the block at 0x1c23000. The memory > map says DAUDIO-[012] for addresses 0x1c22000, 0x1c22400, 0x1c22800, and TDM for > address 0x1c23000. One would assume this meant these are somewhat different. > > > I2S. The biggest use case for this block is getting HDMI audio working > > on the newer > > I understand that. > > > devices(LibreELEC nightlies has a user base of over 300) and I've tested this on > > numerous set ups over the last couple of years. > > Tested on the H3, correct? Yes....but only with the additional changes for multi-channel with my LibreELEC build. These changes I tested on my pine64 before pushing upstream. > > > Failing that reverting (3e9acd7ac693: "ASoC: sun4i-i2s: Remove > > duplicated quirks structure") > > would help. > > I'll take a look. IIRC it worked with the old layout, with the two registers > swapped, playing standard 48 KHz / 16 bit audio when I added supported for > the A83T. Then again maybe the stars were perfectly aligned. At the very least > we could separate A83T and H3 as you suggested. Thanks, CK > > ChenYu > > > > BR, > > CK > > > > > > ChenYu > > > > > > [1] https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.h > > > [2] https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/i2s0/sunxi-i2s0.h > > > [3] https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/daudio0/sunxi-daudio0.h > > > > > > > Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T") > > > > Signed-off-by: Marcus Cooper > > > > --- > > > > sound/soc/sunxi/sun4i-i2s.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c > > > > index 57bf2a33753e..34575a8aa9f6 100644 > > > > --- a/sound/soc/sunxi/sun4i-i2s.c > > > > +++ b/sound/soc/sunxi/sun4i-i2s.c > > > > @@ -1100,7 +1100,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = { > > > > static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = { > > > > .has_reset = true, > > > > .reg_offset_txdata = SUN8I_I2S_FIFO_TX_REG, > > > > - .sun4i_i2s_regmap = &sun4i_i2s_regmap_config, > > > > + .sun4i_i2s_regmap = &sun8i_i2s_regmap_config, > > > > .field_clkdiv_mclk_en = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 8, 8), > > > > .field_fmt_wss = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 2), > > > > .field_fmt_sr = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 6), > > > > -- > > > > 2.23.0 > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > > > > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. > > > > To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190826180734.15801-2-codekipper%40gmail.com. > > > > -- > > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. > > To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmCg4AkqKM-O3C76gto%2BmPWyEdDbviAmRJ8PxLOOMTJ7w%40mail.gmail.com.