From 476ae5840384c7b61eb4270cdf7641772807f100 Mon Sep 17 00:00:00 2001
From: The-going <48602507+The-going@users.noreply.github.com>
Date: Thu, 10 Apr 2025 13:19:52 +0300
Subject: arm64: dts: sun50i-h616: add pwm nodes support

---
 .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 103 ++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index 668ed3b9090a..72d008d6d4e7 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -332,6 +332,44 @@ watchdog: watchdog@30090a0 {
 			clocks = <&osc24M>;
 		};
 
+		pwm: pwm@300a000 {
+			compatible = "allwinner,sun50i-h616-pwm";
+			reg = <0x0300a000 0x400>;
+			clocks = <&osc24M>, <&ccu CLK_BUS_PWM>;
+			clock-names = "mod", "bus";
+			resets = <&ccu RST_BUS_PWM>;
+			pwm-number = <6>;
+			pwm-base = <0x0>;
+			sunxi-pwms = <&pwm0>, <&pwm1>, <&pwm2>,
+			             <&pwm3>, <&pwm4>, <&pwm5>;
+			#pwm-cells = <3>;
+			status = "disabled";
+		};
+
+		pwm0: pwm0@0300a000 {
+			compatible = "allwinner,sunxi-pwm0";
+		};
+
+		pwm1: pwm1@0300a000 {
+			compatible = "allwinner,sunxi-pwm1";
+		};
+
+		pwm2: pwm2@0300a000 {
+			compatible = "allwinner,sunxi-pwm2";
+		};
+
+		pwm3: pwm3@0300a000 {
+			compatible = "allwinner,sunxi-pwm3";
+		};
+
+		pwm4: pwm4@0300a000 {
+			compatible = "allwinner,sunxi-pwm4";
+		};
+
+		pwm5: pwm5@0300a000 {
+			compatible = "allwinner,sunxi-pwm5";
+		};
+
 		pio: pinctrl@300b000 {
 			compatible = "allwinner,sun50i-h616-pinctrl";
 			reg = <0x0300b000 0x400>;
@@ -444,6 +482,71 @@ mmc2_pins: mmc2-pins {
 				bias-pull-up;
 			};
 
+			/omit-if-no-ref/
+			pwm0_pin: pwm0-pin {
+				pins = "PD28";
+				function = "pwm0";
+			};
+
+			/omit-if-no-ref/
+			pwm1_pg_pin: pwm1-pg-pin {
+				pins = "PG19";
+				function = "pwm1";
+			};
+
+			/omit-if-no-ref/
+			pwm1_ph_pin: pwm1-ph-pin {
+				pins = "PH3";
+				function = "pwm1";
+			};
+
+			/omit-if-no-ref/
+			pwm1_pi_pin: pwm1-pi-pin {
+				pins = "PI11";
+				function = "pwm1";
+			};
+
+			/omit-if-no-ref/
+			pwm2_ph_pin: pwm2-ph-pin {
+				pins = "PH2";
+				function = "pwm2";
+			};
+
+			/omit-if-no-ref/
+			pwm2_pi_pin: pwm2-pi-pin {
+				pins = "PI12";
+				function = "pwm2";
+			};
+
+			/omit-if-no-ref/
+			pwm3_ph_pin: pwm3-ph-pin {
+				pins = "PH0";
+				function = "pwm3";
+			};
+
+			/omit-if-no-ref/
+			pwm3_pi_pin: pwm3-pi-pin {
+				pins = "PI13";
+				function = "pwm3";
+			};
+
+			/omit-if-no-ref/
+			pwm4_ph_pin: pwm4-ph-pin {
+				pins = "PH1";
+				function = "pwm4";
+			};
+
+			/omit-if-no-ref/
+			pwm4_pi_pin: pwm4-pi-pin {
+				pins = "PI14";
+				function = "pwm4";
+			};
+
+			pwm5_pin: pwm5-pin {
+				pins = "PA12";
+				function = "pwm5";
+			};
+
 			/omit-if-no-ref/
 			spi0_pins: spi0-pins {
 				pins = "PC0", "PC2", "PC4";
-- 
2.35.3

