Skip to contentSkip to conversation

arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+

PATCH Applied FUKAUMI Naoki 2 participants 3 messages Sep 8, 2022 – Sep 9, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+

only user_led2 (blue) is supported.

user_led1 (green) is not connected to any gpio so it cannot be controlled.

---
v2:
- fix led node label

 .../boot/dts/rockchip/rk3399-rock-pi-4.dtsi   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +21 -0
index 401e1ae9d944..6464a6729729 100644
@@ -6,6 +6,7 @@
 
 /dts-v1/;
 #include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pwm/pwm.h>
 #include "rk3399.dtsi"
 #include "rk3399-opp.dtsi"
@@ -27,6 +28,20 @@ clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&user_led2>;
+
+		/* USER_LED2 */
+		led-0 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk808 1>;
@@ -553,6 +568,12 @@ hp_int: hp-int {
 		};
 	};
 
+	leds {
+		user_led2: user-led2 {
+			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pcie {
 		pcie_pwr_en: pcie-pwr-en {
 			rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
Signature · 7 lines
2.30.2


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

PATCH v2 2/2 arm64: dts: rockchip: add LEDs for ROCK 4C+

add support for user LEDs on Radxa ROCK 4C+ board.

---
v2:
- fix led node label

 .../boot/dts/rockchip/rk3399-rock-4c-plus.dts | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts +34 -0
index a1c4727acfcd..d7051b5d4904 100644
@@ -6,6 +6,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "rk3399.dtsi"
 #include "rk3399-t-opp.dtsi"
 
@@ -38,6 +39,28 @@ clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&user_led1 &user_led2>;
+
+		/* USER_LED1 */
+		led-0 {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-on";
+		};
+
+		/* USER_LED2 */
+		led-1 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
 	vcc5v0_sys: vcc5v0-sys-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc5v0_sys";
@@ -404,6 +427,7 @@ &i2s2 {
 
 &io_domains {
 	bt656-supply = <&vcc_3v0>;
+	audio-supply = <&vcca_1v8>;
 	gpio1830-supply = <&vcc_3v0>;
 	sdmmc-supply = <&vccio_sd>;
 	status = "okay";
@@ -424,6 +448,16 @@ bt_wake_l: bt-wake-l {
 		};
 	};
 
+	leds {
+		user_led1: user-led1 {
+			rockchip,pins = <3 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		user_led2: user-led2 {
+			rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	pmic {
 		pmic_int_l: pmic-int-l {
 			rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
Signature · 7 lines
2.30.2


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
maintainer Applied
#2 lore raw
In reply to FUKAUMI Naoki
Quoted 4 lines · FUKAUMI Naoki

only user_led2 (blue) is supported.

user_led1 (green) is not connected to any gpio so it cannot be controlled.

Applied, thanks!

[1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+

      commit: 7ebfd4f6b52a60820e8d03577fdb082176cd8e79
[2/2] arm64: dts: rockchip: add LEDs for ROCK 4C+
      commit: 6cbd76752791552554e5587f34781408215d1e5b

I've dropped the io-domain addition from patch2. If that is somehow necessary, please send a new patch with an actual commit message explaining the new io-domain.

Best regards,

Signature · 6 lines
Heiko Stuebner <[email protected]>

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