mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valerio Setti <vsetti@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Subject: Re: [PATCH v5 1/7] ASoC: dt-bindings: add amlogic,gxbb-audin
Date: Mon, 16 Nov 2026 23:24:16 +0100	[thread overview]
Message-ID: <71ede0e6-7f8f-4594-ae56-5be10f9159a3@baylibre.com> (raw)
In-Reply-To: <CAFBinCC+-N8LvoXZwMhoxjOzXgoYUfDKCcvmD7Uuph5=hTSg7g@mail.gmail.com>

Hi Martin

 >> +properties:
 >> +  compatible:
 >> +    oneOf:
 >> +      - const: amlogic,gxbb-audin
 >> +      - items:
 >> +          - const: amlogic,gxl-audin
 >> +          - const: amlogic,gxbb-audin
 >  From what I can tell it's even amlogic,meson8-audin compatible.
 > Although I didn't have the time to test in on hardware yet.
 >

Thanks for catching it!
Any testing is more than welcome. I don't have that board at home and, 
based on my quick search, it seems not super easy to find one these days.

 > [...]
 >> +    audio-controller@a000 {
 >> +      compatible = "amlogic,gxbb-audin";
 >> +      reg = <0xa000 0x148>;
 > I believe the audin registers are 0x300 wide.
 > Both, GXL datasheet [0] page 43 and GXM datasheet [1] page 48 claim
 > that the register area is 0x100 wide.
 > The last documented register with AUDIN_ prefix is AUDIN_FIFO2_PIO_RDH
 > = 0xb8. The datasheet [0] (page 395) lists register numbers divided by
 > 4, so to get the actual address in the memory map we need to multiply
 > it by 4, which gives 0x2e0.
 > The 32-bit SoC vendor kernel [2] has a header that states: #define
 > AUDIN_ADDR_END 0x28bf (same as in datasheet, we need to multiply this
 > by 4).

I know that the register layout in these SoC is a bit messy, so let me 
explain how I got to the 0x148 that I wrote above.

When working at this driver I used the S095 and S905X manuals that I 
found online, but based on the link you shared for the S912, I would say 
it's the same when it comes to AUDIN.

Using [0] as reference, the highest register being mentioned in the 
AUDIN chapter is AUD_RESAMPLE_STATUS whose offset is 0x304 (i.e. 0xc1 * 
4). However I noticed that before that there are a lot of registers 
whose name doesn't start with AUDIN_, but rather with AUDOUT_, PCMOUT_, 
PCMIN_.
The first contiguous block of AUDIN_ stops at AUDIN_FIFO_INT which is 
0x148 (= 0x52 * 4). The other AUDIN_ block you mentioned is between 
AUDIN_FIFO0_PIO_STS (at 0x2c0) and AUDIN_FIFO2_PIO_RDH (at 0x2e0).

 > I'm bringing this up because dt-bindings are supposed to be complete.
 > So even if the driver doesn't use a resource yet we're supposed to
 > still describe it.

I perfectly agree with this, but at the same time I thought that 
including registers which potentially do not belong to AUDIN was 
dangerous in the other direction, i.e. we cover a too large area that 
will be hard to use in the future if/when we want to use it and we 
realize it's really not part of AUDIN.

 > I don't see any additional resources that we'd need to describe and
 > #sound-dai-cells allows adding the additional SPDIF input later.

That's exactly why I cut the range at 0x148: that seems to be enough to 
implement what we need for I2S/SPDIF audio input.

Honestly I don't understand what the second range 0x2c0-0x2e0 stands for 
as it's not described in the manual. For sake of curiosity I just tried 
looking into the Hardkernel kernel for Odroid C2 [0] but I didn't find 
any usage of AUDIN_FIFO0_PIO_xxx registers.
So my question is: are we sure we really need them?

[0] https://github.com/hardkernel/linux.git - branch 'odroidc2-3.14.y'

 >  From what I saw in the registers there's also the possibility to send
 > the input signal to AUDIN but I couldn't find any additional resources
 > we'd need to describe in the dt-bindings for this.
 >
 >
 >
 > [0] 
https://dl.khadas.com/products/vim1/datasheet/s905x-datasheet-v0.3.pdf
 > [1] https://dl.khadas.com/products/vim2/datasheet/s912-datasheet.pdf
 > [2] 
https://github.com/endlessm/linux-meson/blob/d6e13c220931110fe676ede6da69fc61a7cb04b6/arch/arm/mach-meson8/include/mach/register.h#L2274

Best regards,

-- 
Valerio


  reply	other threads:[~2026-11-16 22:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 10:17 [PATCH v5 0/7] ASoC: meson: gx: add base support for I2S audio input Valerio Setti
2026-10-18 10:17 ` [PATCH v5 1/7] ASoC: dt-bindings: add amlogic,gxbb-audin Valerio Setti
2026-11-15 21:03   ` Martin Blumenstingl
2026-11-16 22:24     ` Valerio Setti [this message]
2026-10-18 10:17 ` [PATCH v5 2/7] ASoC: meson: build gx-formatter as a separate module Valerio Setti
2026-11-15 21:04   ` Martin Blumenstingl
2026-10-18 10:18 ` [PATCH v5 3/7] ASoC: meson: aiu-encoder-i2s: ensure clk divider gets disabled in hw_free Valerio Setti
2026-11-15 21:09   ` Martin Blumenstingl
2026-10-18 10:18 ` [PATCH v5 4/7] ASoC: meson: add AUDIN driver Valerio Setti
2026-11-15 21:26   ` Martin Blumenstingl
2026-10-18 10:18 ` [PATCH v5 5/7] ASoC: meson: aiu: add I2S Capture DAI Valerio Setti
2026-11-15 21:27   ` Martin Blumenstingl
2026-10-18 10:18 ` [PATCH v5 6/7] ASoC: meson: gx-card: add support for audin FIFO Valerio Setti
2026-11-15 21:28   ` Martin Blumenstingl
2026-11-16 23:06     ` Valerio Setti
2026-10-18 10:18 ` [PATCH v5 7/7] arm64: dts: amlogic: gx: add AUDIN node Valerio Setti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71ede0e6-7f8f-4594-ae56-5be10f9159a3@baylibre.com \
    --to=vsetti@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®