linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A
@ 2022-06-11  6:52 Nicolas Frattaroli
  2022-06-11  6:52 ` [PATCH v3 1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes Nicolas Frattaroli
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Nicolas Frattaroli @ 2022-06-11  6:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: Nicolas Frattaroli, Peter Geis, Michael Riesch, Sascha Hauer,
	Liang Chen, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel

This enables HDMI audio on Quartz64 Model A, and the RK356x SoC in
general.

i2s0 on the RK356x is connected to HDMI, and only has one DMA. I've
confirmed this with the TRM.

To test this, one needs a video clock, i.e. there is no audio if your
screen is off. The framebuffer console or something else needs to be
running to get audio output.

Changes in v3:
 - rebased onto next-20220610

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(+)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes
  2022-06-11  6:52 [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Nicolas Frattaroli
@ 2022-06-11  6:52 ` Nicolas Frattaroli
  2022-06-11  6:53 ` [PATCH v3 2/2] arm64: dts: rockchip: Enable HDMI audio on Quartz64 A Nicolas Frattaroli
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Nicolas Frattaroli @ 2022-06-11  6:52 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: Nicolas Frattaroli, Michael Riesch, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel

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.

Tested-by: Michael Riesch <michael.riesch@wolfvision.net>
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk356x.dtsi | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
index cc1c5a65c5e5..319981c3e9f7 100644
--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi
@@ -183,6 +183,22 @@ opp-800000000 {
 		};
 	};
 
+	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>,
@@ -951,6 +967,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>;
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] arm64: dts: rockchip: Enable HDMI audio on Quartz64 A
  2022-06-11  6:52 [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Nicolas Frattaroli
  2022-06-11  6:52 ` [PATCH v3 1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes Nicolas Frattaroli
@ 2022-06-11  6:53 ` Nicolas Frattaroli
  2022-06-11 13:50 ` [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Peter Geis
  2022-06-11 15:15 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Nicolas Frattaroli @ 2022-06-11  6:53 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner
  Cc: Nicolas Frattaroli, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel

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

Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
index 59e364b724cc..981c4aeea814 100644
--- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
@@ -310,6 +310,10 @@ hdmi_out_con: endpoint {
 	};
 };
 
+&hdmi_sound {
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -540,6 +544,10 @@ &i2c3 {
 	status = "okay";
 };
 
+&i2s0_8ch {
+	status = "okay";
+};
+
 &i2s1_8ch {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2s1m0_sclktx
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A
  2022-06-11  6:52 [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Nicolas Frattaroli
  2022-06-11  6:52 ` [PATCH v3 1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes Nicolas Frattaroli
  2022-06-11  6:53 ` [PATCH v3 2/2] arm64: dts: rockchip: Enable HDMI audio on Quartz64 A Nicolas Frattaroli
@ 2022-06-11 13:50 ` Peter Geis
  2022-06-11 15:15 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Geis @ 2022-06-11 13:50 UTC (permalink / raw)
  To: Nicolas Frattaroli
  Cc: Rob Herring, Krzysztof Kozlowski, Heiko Stuebner, Michael Riesch,
	Sascha Hauer, Liang Chen, devicetree, arm-mail-list,
	open list:ARM/Rockchip SoC...,
	Linux Kernel Mailing List

On Sat, Jun 11, 2022 at 2:53 AM Nicolas Frattaroli
<frattaroli.nicolas@gmail.com> wrote:
>
> This enables HDMI audio on Quartz64 Model A, and the RK356x SoC in
> general.
>
> i2s0 on the RK356x is connected to HDMI, and only has one DMA. I've
> confirmed this with the TRM.
>
> To test this, one needs a video clock, i.e. there is no audio if your
> screen is off. The framebuffer console or something else needs to be
> running to get audio output.

Excellent work!
Tested on Quartz64 Model A.
Tested-by: Peter Geis <pgwipeout@gmail.com>

>
> Changes in v3:
>  - rebased onto next-20220610
>
> 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(+)
>
> --
> 2.36.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A
  2022-06-11  6:52 [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Nicolas Frattaroli
                   ` (2 preceding siblings ...)
  2022-06-11 13:50 ` [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Peter Geis
@ 2022-06-11 15:15 ` Heiko Stuebner
  3 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2022-06-11 15:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Nicolas Frattaroli, Rob Herring
  Cc: Heiko Stuebner, linux-arm-kernel, Peter Geis, Liang Chen,
	linux-kernel, Sascha Hauer, devicetree, Michael Riesch,
	linux-rockchip

On Sat, 11 Jun 2022 08:52:58 +0200, Nicolas Frattaroli wrote:
> This enables HDMI audio on Quartz64 Model A, and the RK356x SoC in
> general.
> 
> i2s0 on the RK356x is connected to HDMI, and only has one DMA. I've
> confirmed this with the TRM.
> 
> To test this, one needs a video clock, i.e. there is no audio if your
> screen is off. The framebuffer console or something else needs to be
> running to get audio output.
> 
> [...]

Applied, thanks!

[1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes
      commit: 697ee8546e241bd5fc175c0cfd5d8b0c8ce39697
[2/2] arm64: dts: rockchip: Enable HDMI audio on Quartz64 A
      commit: 4188962d993ef3633a61f66ba5afe9e43088f3c5

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-11 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-11  6:52 [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Nicolas Frattaroli
2022-06-11  6:52 ` [PATCH v3 1/2] arm64: dts: rockchip: rk356x: Add HDMI audio nodes Nicolas Frattaroli
2022-06-11  6:53 ` [PATCH v3 2/2] arm64: dts: rockchip: Enable HDMI audio on Quartz64 A Nicolas Frattaroli
2022-06-11 13:50 ` [PATCH v3 0/2] HDMI Audio on RK356x/Quartz64 Model A Peter Geis
2022-06-11 15:15 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).