diff mbox series

[2/7] ARM: dts: exynos: k3g: Add GPIO keys support

Message ID 20230716220644.22158-4-markuss.broks@gmail.com
State Superseded
Headers show
Series Add various peripheral support for K3G | expand

Commit Message

Markuss Broks July 16, 2023, 10:05 p.m. UTC
Add the four physical buttons support, volume buttons have
external pull-up resistors.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
---
 arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 60 ++++++++++++++++++++
 1 file changed, 60 insertions(+)

Comments

Krzysztof Kozlowski July 19, 2023, 9:04 a.m. UTC | #1
On 17/07/2023 00:05, Markuss Broks wrote:
> Add the four physical buttons support, volume buttons have
> external pull-up resistors.
> 
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> ---
>  arch/arm/boot/dts/exynos5422-samsung-k3g.dts | 60 ++++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 

Is it a duplicate? You know it cannot be then applied?

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
index 1a11a6993ba7..c3e006dc34ea 100644
--- a/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
+++ b/arch/arm/boot/dts/exynos5422-samsung-k3g.dts
@@ -8,6 +8,7 @@ 
 /dts-v1/;
 #include <dt-bindings/clock/samsung,s2mps11.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include "exynos5800.dtsi"
 #include "exynos5422-cpus.dtsi"
@@ -21,6 +22,45 @@  / {
 
 	aliases {
 		mmc0 = &mmc_0;
+		mmc1 = &mmc_1;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&power_gpio &volume_up_gpio &volume_down_gpio &home_gpio>;
+
+		key-volume-up {
+			label = "Volume Up";
+			gpios = <&gpx0 2 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+			debounce-interval = <15>;
+		};
+
+		key-volume-down {
+			label = "Volume Down";
+			gpios = <&gpx0 3 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEDOWN>;
+			debounce-interval = <15>;
+		};
+
+		key-home {
+			label = "Home";
+			gpios = <&gpx0 5 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_HOMEPAGE>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		key-power {
+			label = "Power";
+			gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_POWER>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
 	};
 
 	memory@20000000 {
@@ -641,6 +681,21 @@  &mmc_1 {
 };
 
 &pinctrl_0 {
+	volume_up_gpio: volume-up-pins {
+		samsung,pins = "gpx0-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	volume_down_gpio: volume-down-pins {
+		samsung,pins = "gpx0-3";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; /* External pull up */
+	};
+
+	home_gpio: home-key-pins {
+		samsung,pins = "gpx0-5";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	s2mps11_irq: s2mps11-irq-pins {
 		samsung,pins = "gpx0-7";
 		samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
@@ -653,6 +708,11 @@  touch_irq: touch-irq-pins {
 		samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
 	};
 
+	power_gpio: power-key-pins {
+		samsung,pins = "gpx2-2";
+		samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
+	};
+
 	wlan_reset: wlan-reset {
 		samsung,pins = "gpy7-7";
 		samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;