Skip to contentSkip to conversation

HDMI Audio on RK356x/Quartz64 Model A

PATCH Superseded Nicolas Frattaroli 1 participant 3 messages Nov 26, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover HDMI Audio on RK356x/Quartz64 Model A

This enables HDMI audio on Quartz64 Model A, and the RK356x SoC in general. The patches require the VOP2 patchset[1] and my I2S/TDM controller fix[2] to work.

i2s0 on the RK356x is connected to HDMI, and only has one DMA. I've confirmed this with the TRM. With [2] the driver now handles this properly, and does not try to register a capture PCM in this case.

To test this, one needs a video clock, i.e. there is no audio if your screen is off. I've found that running kmscube momentarily is enough to make the VOP2 keep the screen turned on indefinitely, which is a pleasant quirk in this case.

Changes in v2:
- reordered nodes in rk356x.dtsi to conform
- reordered properties in rk356x.dtsi to conform
- add Michael Riesch's Tested-by to rk356x.dtsi

Nicolas Frattaroli (2):
arm64: dts: rockchip: rk356x: Add HDMI audio nodes
arm64: dts: rockchip: Enable HDMI audio on Quartz64 A

 .../boot/dts/rockchip/rk3566-quartz64-a.dts   |  8 +++++
 arch/arm64/boot/dts/rockchip/rk356x.dtsi      | 33 +++++++++++++++++++
 2 files changed, 41 insertions(+)
Signature · 7 lines
2.34.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
#1 lore raw

PATCH v2 1/2 arm64: dts: rockchip: rk356x: Add HDMI audio nodes

This adds the i2s0 node and an hdmi-sound sound device to the rk356x device tree. On the rk356[68], the i2s0 controller is connected to HDMI audio.

---

Changes in v2:
- reordered nodes to conform
- reordered properties to conform
- add Michael Riesch's Tested-by

 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/rockchip/rk356x.dtsi +33 -0
index 3c09cf6d4c37..aafb622dfa83 100644
@@ -174,6 +174,22 @@ scmi_clk: protocol@14 {
 		};
 	};
 
+	hdmi_sound: hdmi-sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "HDMI";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,mclk-fs = <256>;
+		status = "disabled";
+
+		simple-audio-card,codec {
+			sound-dai = <&hdmi>;
+		};
+
+		simple-audio-card,cpu {
+			sound-dai = <&i2s0_8ch>;
+		};
+	};
+
 	pmu {
 		compatible = "arm,cortex-a55-pmu";
 		interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>,
@@ -789,6 +805,23 @@ spdif: spdif@fe460000 {
 		status = "disabled";
 	};
 
+	i2s0_8ch: i2s@fe400000 {
+		compatible = "rockchip,rk3568-i2s-tdm";
+		reg = <0x0 0xfe400000 0x0 0x1000>;
+		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+		assigned-clocks = <&cru CLK_I2S0_8CH_TX_SRC>, <&cru CLK_I2S0_8CH_RX_SRC>;
+		assigned-clock-rates = <1188000000>, <1188000000>;
+		clocks = <&cru MCLK_I2S0_8CH_TX>, <&cru MCLK_I2S0_8CH_RX>, <&cru HCLK_I2S0_8CH>;
+		clock-names = "mclk_tx", "mclk_rx", "hclk";
+		dmas = <&dmac1 0>;
+		dma-names = "tx";
+		resets = <&cru SRST_M_I2S0_8CH_TX>, <&cru SRST_M_I2S0_8CH_RX>;
+		reset-names = "tx-m", "rx-m";
+		rockchip,grf = <&grf>;
+		#sound-dai-cells = <0>;
+		status = "disabled";
+	};
+
 	i2s1_8ch: i2s@fe410000 {
 		compatible = "rockchip,rk3568-i2s-tdm";
 		reg = <0x0 0xfe410000 0x0 0x1000>;
Signature · 7 lines
2.34.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH v2 2/2 arm64: dts: rockchip: Enable HDMI audio on Quartz64 A

In reply to Nicolas Frattaroli

This enables the i2s0 controller and the hdmi-sound node on the PINE64 Quartz64 Model A single-board computer.

---
 arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts +8 -0
index a4453c82b03d..0598510dce58 100644
@@ -215,6 +215,10 @@ &hdmi_in_vp0 {
 	status = "okay";
 };
 
+&hdmi_sound {
+	status = "okay";
+};
+
 &gpu {
 	mali-supply = <&vdd_gpu>;
 	status = "okay";
@@ -444,6 +448,10 @@ regulator-state-mem {
 	};
 };
 
+&i2s0_8ch {
+	status = "okay";
+};
+
 &i2s1_8ch {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2s1m0_sclktx
Signature · 7 lines
2.34.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip