diff mbox series

pwm-leds for Orange Pi 5

Message ID 20241022224653.1483-2-honyuenkwun@gmail.com (mailing list archive)
State New
Headers show
Series pwm-leds for Orange Pi 5 | expand

Commit Message

Jimmy Hon Oct. 22, 2024, 10:46 p.m. UTC
The green LED RUN is driven by PWM0_LED that can be controlled by PWM0_M2

Fixes: b6bc755d806e ("arm64: dts: rockchip: Add Orange Pi 5")
Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
---
Based off of v6.12-armsoc/dtsfixes in the same spirit as the cleaning up of
enable-active-low
This change will also avoid the DTB warning when using the id "leds-gpio"
This commit basically implements Ondřej Jirman suggestion from the first
patch series. [1]

[1] https://patchwork.kernel.org/project/linux-rockchip/patch/a1eca379d151c3f91f4cd4e1751ba389096c4f13.1692102057.git.efectn@6tel.net/#25472495

 .../boot/dts/rockchip/rk3588s-orangepi-5.dts  | 26 +++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Jimmy Hon Oct. 22, 2024, 11 p.m. UTC | #1
Oh shoot. I forgot the subsystem prefixes in the subject line. I'll
add them out in v2.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
index 6b77be643249..c78eb298a017 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
@@ -36,15 +36,15 @@  button-recovery {
 		};
 	};
 
-	leds {
-		compatible = "gpio-leds";
-		pinctrl-names = "default";
-		pinctrl-0 = <&leds_gpio>;
+	pwm-leds {
+		compatible = "pwm-leds";
 
-		led-1 {
-			gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
-			label = "status_led";
+		led {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_STATUS;
 			linux,default-trigger = "heartbeat";
+			max-brightness = <255>;
+			pwms = <&pwm0 0 25000 0>;
 		};
 	};
 
@@ -297,12 +297,6 @@  &pcie2x1l2 {
 };
 
 &pinctrl {
-	gpio-func {
-		leds_gpio: leds-gpio {
-			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
-		};
-	};
-
 	hym8563 {
 		hym8563_int: hym8563-int {
 			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
@@ -320,6 +314,12 @@  typec5v_pwren: typec5v-pwren {
 	};
 };
 
+&pwm0 {
+	pinctrl-0 = <&pwm0m2_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
 &saradc {
 	vref-supply = <&avcc_1v8_s0>;
 	status = "okay";