From bf158ec720514f6b714ae71cb95d5792fdbc411d Mon Sep 17 00:00:00 2001
From: Jernej Skrabec <jernej.skrabec@gmail.com>
Date: Thu, 1 Sep 2022 17:49:28 +0200
Subject: arm64: dts: allwinner: h6: enable AC200 codec

Enable AC200 analog codec on H6 based boards where present.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 25 +++++++++++++++++++
 .../boot/dts/allwinner/sun50i-h6-pine-h64.dts | 25 +++++++++++++++++++
 .../allwinner/sun50i-h6-tanix-tx6-mini.dts    | 14 +++++++++++
 3 files changed, 64 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
index 5371662e52e7..74c9e4bac60d 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
@@ -104,6 +104,19 @@ wifi_pwrseq: wifi-pwrseq {
 	};
 };
 
+&ac200_codec {
+	avcc-supply = <&reg_aldo2>;
+	status = "okay";
+};
+
+&ac200_pwm_clk {
+	status = "okay";
+};
+
+&analog {
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&reg_dcdca>;
 };
@@ -133,6 +146,14 @@ &i2s1 {
 	status = "okay";
 };
 
+&i2c3 {
+	status = "okay";
+};
+
+&i2s3 {
+	status = "okay";
+};
+
 &hdmi {
 	status = "okay";
 };
@@ -220,6 +241,10 @@ &pio {
 	vcc-pg-supply = <&reg_vcc_wifi_io>;
 };
 
+&pwm {
+	status = "okay";
+};
+
 &r_ir {
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
index cb7231b386cd..e4796586dc79 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-pine-h64.dts
@@ -93,6 +93,19 @@ &dwc3 {
 	status = "okay";
 };
 
+&ac200_codec {
+	avcc-supply = <&reg_aldo2>;
+	status = "okay";
+};
+
+&ac200_pwm_clk {
+	status = "okay";
+};
+
+&analog {
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&reg_dcdca>;
 };
@@ -139,6 +152,14 @@ &i2s1 {
 	status = "okay";
 };
 
+&i2c3 {
+	status = "okay";
+};
+
+&i2s3 {
+	status = "okay";
+};
+
 &mdio {
 	ext_rgmii_phy: ethernet-phy@1 {
 		compatible = "ethernet-phy-ieee802.3-c22";
@@ -196,6 +217,10 @@ &pio {
 	vcc-pg-supply = <&reg_aldo1>;
 };
 
+&pwm {
+	status = "okay";
+};
+
 &r_i2c {
 	status = "okay";
 
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6-mini.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6-mini.dts
index 08d84160d88f..931e8b99fd93 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6-mini.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6-mini.dts
@@ -10,6 +10,20 @@ / {
 	compatible = "oranth,tanix-tx6-mini", "allwinner,sun50i-h6";
 };
 
+
+&ac200_codec {
+	avcc-supply = <&reg_vcc3v3>;
+	status = "okay";
+};
+
+&analog {
+	status = "okay";
+};
+
+&i2s3 {
+	status = "okay";
+};
+
 &r_ir {
 	linux,rc-map-name = "rc-tanix-tx3mini";
 };
-- 
2.35.3

