linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+
@ 2022-09-07  4:59 FUKAUMI Naoki
  2022-09-07  4:59 ` [PATCH 2/2] arm64: dts: rockchip: add LEDs for ROCK 4C+ FUKAUMI Naoki
  2022-09-07  8:21 ` [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ Heiko Stübner
  0 siblings, 2 replies; 3+ messages in thread
From: FUKAUMI Naoki @ 2022-09-07  4:59 UTC (permalink / raw)
  To: heiko; +Cc: linux-arm-kernel, linux-rockchip, FUKAUMI Naoki

only user_led2 (blue) is supported.

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

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
---
 .../boot/dts/rockchip/rk3399-rock-pi-4.dtsi   | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
index 401e1ae9d944..49126560b30b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
@@ -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,19 @@ clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&user_led2>;
+
+		user_led2 {
+			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 +567,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>;
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] arm64: dts: rockchip: add LEDs for ROCK 4C+
  2022-09-07  4:59 [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ FUKAUMI Naoki
@ 2022-09-07  4:59 ` FUKAUMI Naoki
  2022-09-07  8:21 ` [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ Heiko Stübner
  1 sibling, 0 replies; 3+ messages in thread
From: FUKAUMI Naoki @ 2022-09-07  4:59 UTC (permalink / raw)
  To: heiko; +Cc: linux-arm-kernel, linux-rockchip, FUKAUMI Naoki

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

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
---
 .../boot/dts/rockchip/rk3399-rock-4c-plus.dts | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
index a1c4727acfcd..effe514e87dc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-4c-plus.dts
@@ -6,6 +6,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "rk3399.dtsi"
 #include "rk3399-t-opp.dtsi"
 
@@ -38,6 +39,26 @@ clkin_gmac: external-gmac-clock {
 		#clock-cells = <0>;
 	};
 
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&user_led1 &user_led2>;
+
+		user_led1 {
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "default-on";
+		};
+
+		user_led2 {
+			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 +425,7 @@ &i2s2 {
 
 &io_domains {
 	bt656-supply = <&vcc_3v0>;
+	audio-supply = <&vcca_1v8>;
 	gpio1830-supply = <&vcc_3v0>;
 	sdmmc-supply = <&vccio_sd>;
 	status = "okay";
@@ -424,6 +446,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>;
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+
  2022-09-07  4:59 [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ FUKAUMI Naoki
  2022-09-07  4:59 ` [PATCH 2/2] arm64: dts: rockchip: add LEDs for ROCK 4C+ FUKAUMI Naoki
@ 2022-09-07  8:21 ` Heiko Stübner
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2022-09-07  8:21 UTC (permalink / raw)
  To: FUKAUMI Naoki; +Cc: linux-arm-kernel, linux-rockchip, FUKAUMI Naoki

Hi,

Am Mittwoch, 7. September 2022, 06:59:24 CEST schrieb FUKAUMI Naoki:
> only user_led2 (blue) is supported.
> 
> user_led1 (green) is not connected to any gpio so it cannot be
> controlled.
> 
> Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
> ---
>  .../boot/dts/rockchip/rk3399-rock-pi-4.dtsi   | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
> index 401e1ae9d944..49126560b30b 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
> @@ -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,19 @@ clkin_gmac: external-gmac-clock {
>  		#clock-cells = <0>;
>  	};
>  
> +	leds {
> +		compatible = "gpio-leds";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&user_led2>;
> +
> +		user_led2 {

Node names should definitly use "-" not underscores.

Also gpio-leds define a pattern for node names in the yaml binding:
	"(^led-[0-9a-f]$|led)":

So running dtbscheck on those new nodes should have found new
errors with that addition.

See commit e916d85b922f ("arm64: dts: rockchip: rename and label gpio-led subnodes")
where existing already were already converted to be binding compliant.


Heiko


> +			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 +567,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>;
> 





_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-09-07  8:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07  4:59 [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ FUKAUMI Naoki
2022-09-07  4:59 ` [PATCH 2/2] arm64: dts: rockchip: add LEDs for ROCK 4C+ FUKAUMI Naoki
2022-09-07  8:21 ` [PATCH 1/2] arm64: dts: rockchip: add LED for ROCK Pi 4A/B/C/A+/B+ Heiko Stübner

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).