From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Thu, 1 Sep 2022 17:45:03 +0200
Subject: arm64: dts: allwinner: h6: add AC200 codec nodes

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 42 ++++++++++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -24,6 +24,22 @@ aliases {
 		mmc2 = &mmc2;
 	};
 
+	analog: analog-codec {
+		compatible = "simple-audio-card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,name = "ac200-audio";
+		simple-audio-card,mclk-fs = <512>;
+		status = "disabled";
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s3>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&ac200_codec>;
+		};
+	};
+
 	ac200_pwm_clk: ac200_clk {
 		compatible = "pwm-clock";
 		#clock-cells = <0>;
@@ -456,6 +472,11 @@ i2c3_pins: i2c3-pins {
 				bias-pull-up;
 			};
 
+			i2s3_pins: i2s3-pins {
+				pins = "PB12", "PB13", "PB14", "PB15", "PB16";
+				function = "i2s3";
+			};
+
 			mmc0_pins: mmc0-pins {
 				pins = "PF0", "PF1", "PF2", "PF3",
 				       "PF4", "PF5";
@@ -734,6 +755,12 @@ ac200_ephy_ctl: syscon {
 					phy-mode = "rmii";
 					status = "disabled";
 				};
+
+				ac200_codec: codec {
+					#sound-dai-cells = <0>;
+					compatible = "x-powers,ac200-codec";
+					status = "disabled";
+				};
 			};
 		};
 
@@ -791,6 +818,21 @@ mdio: mdio {
 			};
 		};
 
+		i2s3: i2s@508f000 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-h6-i2s";
+			reg = <0x0508f000 0x1000>;
+			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2S3>, <&ccu CLK_I2S3>;
+			clock-names = "apb", "mod";
+			dmas = <&dma 6>, <&dma 6>;
+			resets = <&ccu RST_BUS_I2S3>;
+			dma-names = "rx", "tx";
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2s3_pins>;
+			status = "disabled";
+		};
+
 		i2s1: i2s@5091000 {
 			#sound-dai-cells = <0>;
 			compatible = "allwinner,sun50i-h6-i2s";
-- 
Armbian

