[PATCH 6/6] arm64: dts: amlogic: gx: add nodes for audin and its FIFOs

Valerio Setti vsetti at baylibre.com
Fri Sep 11 15:14:36 PDT 2026


Add nodes to provide audio input support to Amlogic Meson GXBB/GXL
platforms:
- audin is the parent node that spans the entire register range and
  implements the data formatters.
- audin_fifo are the child nodes that implement the FIFO: they receive
  formatted data from the interfaces and then bulk transfer it to RAM
  when the FIFO is full.

What's missing after this to get capture support working is to connect a
capture capable codec to the SoC. For example to test these changes an
NXP SGTL5000 chip has been connected to and OdroidC2 (Meson GXBB) board
using a custom hat board.

The following additions are required on 'amlogic/meson-gxbb-odroidc2.dts'
to make that hat board to work:

    &sound {
            audio-aux-devs = <&audin>;
            audio-routing = "AUDIN I2S Formatter", "AIU I2S Encoder Capture",
                            "AUDIN FIFO0 I2S IN", "AUDIN I2S Formatter";

            dai-link-1 {
                    codec-1 {
                            sound-dai = <&sgtl5000>;
                    };
            };

            dai-link-2 {
                    sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
                    dai-format = "i2s";
                    mclk-fs = <256>;

                    codec-0 {
                            sound-dai = <&sgtl5000>;
                    };
            };

            dai-link-3 {
                    sound-dai = <&audin_fifo0>;
            };
    };

    &audin {
            status = "okay";
    };

    &audin_fifo0 {
            status = "okay";
    };

Then, from userspace:

    $ amixer sset 'AUDIN FIFO0 SRC SEL' 'I2S'
    $ arecord -l  # find the "FIFO Capture" device
    $ arecord -D hw:0,<N> -f S16_LE -r 48000 -c 2 /tmp/in.wav

Signed-off-by: Valerio Setti <vsetti at baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi   | 35 +++++++++++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 22 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 22 ++++++++++++++++++
 3 files changed, 79 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index c1d8e81d95cb..68632ed86e8c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -436,6 +436,41 @@ watchdog at 98d0 {
 				reg = <0x0 0x098d0 0x0 0x10>;
 				clocks = <&xtal>;
 			};
+
+			audin: audio-controller at a000 {
+				compatible = "amlogic,meson-gx-audin";
+				reg = <0x0 0xa000 0x0 0x308>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0x0 0x0 0xa000 0x308>;
+				interrupts = <GIC_SPI 7 IRQ_TYPE_EDGE_RISING>;
+				sound-name-prefix = "AUDIN";
+				status = "disabled";
+
+				audin_fifo0: audio-controller at 80 {
+					compatible = "amlogic,meson-gx-audin-fifo";
+					reg = <0x80 0x1c>;
+					#sound-dai-cells = <0>;
+					sound-name-prefix = "AUDIN FIFO0";
+					status = "disabled";
+				};
+
+				audin_fifo1: audio-controller at cc {
+					compatible = "amlogic,meson-gx-audin-fifo";
+					reg = <0xcc 0x1c>;
+					#sound-dai-cells = <0>;
+					sound-name-prefix = "AUDIN FIFO1";
+					status = "disabled";
+				};
+
+				audin_fifo2: audio-controller at 114 {
+					compatible = "amlogic,meson-gx-audin-fifo";
+					reg = <0x114 0x1c>;
+					#sound-dai-cells = <0>;
+					sound-name-prefix = "AUDIN FIFO2";
+					status = "disabled";
+				};
+			};
 		};
 
 		gic: interrupt-controller at c4301000 {
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index a9c830a570cc..53cc92ebbc9f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -84,6 +84,28 @@ &aiu {
 	resets = <&reset RESET_AIU>;
 };
 
+&audin {
+	compatible = "amlogic,meson-gxbb-audin",
+		     "amlogic,meson-gx-audin";
+	clocks = <&clkc CLKID_I2S_SPDIF>;
+	resets = <&reset RESET_AUDIN>;
+};
+
+&audin_fifo0 {
+	compatible = "amlogic,meson-gxbb-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
+&audin_fifo1 {
+	compatible = "amlogic,meson-gxbb-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
+&audin_fifo2 {
+	compatible = "amlogic,meson-gxbb-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
 &aobus {
 	pinctrl_aobus: pinctrl at 14 {
 		compatible = "amlogic,meson-gxbb-aobus-pinctrl";
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index d5e0f72892f8..be8fac36fb59 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -100,6 +100,28 @@ &aiu {
 	resets = <&reset RESET_AIU>;
 };
 
+&audin {
+	compatible = "amlogic,meson-gxl-audin",
+		     "amlogic,meson-gx-audin";
+	clocks = <&clkc CLKID_I2S_SPDIF>;
+	resets = <&reset RESET_AUDIN>;
+};
+
+&audin_fifo0 {
+	compatible = "amlogic,meson-gxl-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
+&audin_fifo1 {
+	compatible = "amlogic,meson-gxl-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
+&audin_fifo2 {
+	compatible = "amlogic,meson-gxl-audin-fifo",
+		     "amlogic,meson-gx-audin-fifo";
+};
+
 &apb {
 	usb2_phy0: phy at 78000 {
 		compatible = "amlogic,meson-gxl-usb2-phy";

-- 
2.47.3




More information about the linux-amlogic mailing list