Skip to contentSkip to conversation

arm64: dts: renesas: gray-hawk-single: Add push switches and GP LEDs

PATCH New Geert Uytterhoeven 1 participant 3 messages Jul 22, 2024

Subsystems (2)
lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

cover arm64: dts: renesas: gray-hawk-single: Add push switches and GP LEDs

Hi all,

This patch series adds support for the Push Switches and General Purpose LEDs on the Gray Hawk Single board, so the former can be used for user input, and the latter can be used as indicator LEDs.

To be queued in renesas-devel for v6.12.

Thanks for your comments!

Geert Uytterhoeven (2):
arm64: dts: renesas: gray-hawk-single: Add push switches
arm64: dts: renesas: gray-hawk-single: Add GP LEDs

 .../dts/renesas/r8a779h0-gray-hawk-single.dts | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH 1/2 arm64: dts: renesas: gray-hawk-single: Add push switches

Describe the three Push Switches on the Gray Hawk Single board, so they can be used for user input.

---
 .../dts/renesas/r8a779h0-gray-hawk-single.dts | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts +37 -0
index ae2ad93228110905..b4fcf6c0cea26840 100644
@@ -9,6 +9,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 #include "r8a779h0.dtsi"
 
@@ -38,6 +39,37 @@ chosen {
 		stdout-path = "serial0:921600n8";
 	};
 
+	keys {
+		compatible = "gpio-keys";
+
+		pinctrl-0 = <&keys_pins>;
+		pinctrl-names = "default";
+
+		key-1 {
+			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_1>;
+			label = "SW47";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-2 {
+			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_2>;
+			label = "SW48";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		key-3 {
+			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_3>;
+			label = "SW49";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+	};
+
 	memory@48000000 {
 		device_type = "memory";
 		/* first 128MB is reserved for secure area. */
@@ -234,6 +266,11 @@ i2c0_pins: i2c0 {
 		function = "i2c0";
 	};
 
+	keys_pins: keys {
+		pins = "GP_5_0", "GP_5_1", "GP_5_2";
+		bias-pull-up;
+	};
+
 	mmc_pins: mmc {
 		groups = "mmc_data8", "mmc_ctrl", "mmc_ds";
 		function = "mmc";
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/2 arm64: dts: renesas: gray-hawk-single: Add GP LEDs

In reply to Geert Uytterhoeven

Describe the three General Purpose LEDs on the Gray Hawk Single board, so they can be used as indicator LEDs.

---
 .../dts/renesas/r8a779h0-gray-hawk-single.dts | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts +26 -0
index b4fcf6c0cea26840..b8ed1d0edd5a92b5 100644
@@ -10,6 +10,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "r8a779h0.dtsi"
 
@@ -70,6 +71,31 @@ key-3 {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led-1 {
+			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <1>;
+		};
+
+		led-2 {
+			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <2>;
+		};
+
+		led-3 {
+			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			function-enumerator = <3>;
+		};
+	};
+
 	memory@48000000 {
 		device_type = "memory";
 		/* first 128MB is reserved for secure area. */
Signature · 1 line
2.34.1