Re: [PATCH v5 1/7] ASoC: dt-bindings: add amlogic,gxbb-audin

From: Valerio Setti

Date: Mon Nov 16 2026 - 17:24:24 EST


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