From b7211dbb4da677436979e70c65bfecd81030c5e7 Mon Sep 17 00:00:00 2001
From: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Date: Tue, 11 Feb 2025 13:11:07 +0000
Subject: [PATCH] arm64: dts: Add the Audio Out block to rp1.dtsi

Change the standard rate of PLL_AUDIO_SEC from 192MHz to
153.6MHz to suit audio out.

Declare audio out hardware and give it a named pin control.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
---
 arch/arm64/boot/dts/broadcom/rp1.dtsi | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

--- a/arch/arm64/boot/dts/broadcom/rp1.dtsi
+++ b/arch/arm64/boot/dts/broadcom/rp1.dtsi
@@ -49,7 +49,7 @@
 					       <125000000>,  // RP1_PLL_SYS_SEC
 					       <125000000>,  // RP1_CLK_ETH
 					       <61440000>,   // RP1_PLL_AUDIO
-					       <192000000>,  // RP1_PLL_AUDIO_SEC
+					       <153600000>,  // RP1_PLL_AUDIO_SEC
 					       <200000000>,  // RP1_CLK_SYS
 					       <100000000>,  // RP1_PLL_SYS_PRI_PH
 					       // Must match the XOSC frequency
@@ -380,6 +380,20 @@
 			status = "disabled";
 		};
 
+		rp1_audio_out: audio_out@94000 {
+			compatible = "raspberrypi,rp1-audio-out";
+			reg = <0xc0 0x40094000 0x0 0x4000>;
+			clocks = <&rp1_clocks RP1_CLK_AUDIO_OUT>;
+			assigned-clocks = <&rp1_clocks RP1_CLK_AUDIO_OUT>;
+			assigned-clock-rates = <153600000>;
+			assigned-clock-parents = <&rp1_clocks RP1_PLL_AUDIO_SEC>;
+			dmas = <&rp1_dma RP1_DMA_AUDIO_OUT>;
+			dma-maxburst = <4>;
+			dma-names = "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
 		rp1_pwm0: pwm@98000 {
 			compatible = "raspberrypi,rp1-pwm";
 			reg = <0xc0 0x40098000  0x0 0x100>;
@@ -974,6 +988,12 @@
 				pins = "gpio52", "gpio53";
 				bias-pull-up;
 			};
+
+			rp1_audio_out_12_13: rp1_audio_out_12_13 {
+				function = "aaud";
+				pins = "gpio12", "gpio13";
+				bias-disable;
+			};
 		};
 
 		rp1_eth: ethernet@100000 {
