From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: palachzzz <7zzzzzzz@mail.ru>
Date: Thu, 27 Feb 2025 23:06:51 +0800
Subject: [ARCHEOLOGY] RK3588 add HDMI sound, add support for OPi5 Max #7884

> X-Git-Archeology: - Revision 0b88561ec332114404ff8075ab6bc2419ca66a47: https://github.com/armbian/build/commit/0b88561ec332114404ff8075ab6bc2419ca66a47
> X-Git-Archeology:   Date: Thu, 27 Feb 2025 23:06:51 +0800
> X-Git-Archeology:   From: palachzzz <7zzzzzzz@mail.ru>
> X-Git-Archeology:   Subject: RK3588 add HDMI sound, add support for OPi5 Max #7884
> X-Git-Archeology:
---
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi  | 17 ++++++++++
 arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi | 17 ++++++++++
 2 files changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
@@ -382,6 +382,22 @@ scmi_reset: protocol@16 {
 		};
 	};
 
+	hdmi0_sound: hdmi0-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,mclk-fs = <128>;
+		simple-audio-card,name = "hdmi0";
+		status = "disabled";
+
+		simple-audio-card,codec {
+			sound-dai = <&hdmi0>;
+		};
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s5_8ch>;
+		};
+	};
+
 	pmu-a55 {
 		compatible = "arm,cortex-a55-pmu";
 		interrupts = <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH &ppi_partition0>;
@@ -1404,6 +1420,7 @@ hdmi0: hdmi@fde80000 {
 		reset-names = "ref", "hdp";
 		rockchip,grf = <&sys_grf>;
 		rockchip,vo-grf = <&vo1_grf>;
+		#sound-dai-cells = <0>;
 		status = "disabled";
 
 		ports {
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi
@@ -30,6 +30,22 @@ hdmi_receiver_cma: hdmi-receiver-cma {
 		};
 	};
 
+	hdmi1_sound: hdmi1-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,mclk-fs = <128>;
+		simple-audio-card,name = "hdmi1";
+		status = "disabled";
+
+		simple-audio-card,codec {
+			sound-dai = <&hdmi1>;
+		};
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s6_8ch>;
+		};
+	};
+
 	usb_host1_xhci: usb@fc400000 {
 		compatible = "rockchip,rk3588-dwc3", "snps,dwc3";
 		reg = <0x0 0xfc400000 0x0 0x400000>;
@@ -221,6 +237,7 @@ hdmi1: hdmi@fdea0000 {
 		reset-names = "ref", "hdp";
 		rockchip,grf = <&sys_grf>;
 		rockchip,vo-grf = <&vo1_grf>;
+		#sound-dai-cells = <0>;
 		status = "disabled";
 
 		ports {
-- 
Armbian

