diff mbox series

[v2,10/12] arm64: dts: hi3660: add power key dts node

Message ID 20170525081854.4701-11-guodong.xu@linaro.org
State Superseded
Headers show
Series arm64: dts: hi3660: add device nodes | expand

Commit Message

Guodong Xu May 25, 2017, 8:18 a.m. UTC
From: Chen Jun <chenjun14@huawei.com>


We use gpio_034 as power key on hikey960, and set gpio with pull-up
state, when key press the voltage on the gpio will come to lower, and
power key event will be reported.

Signed-off-by: Chen Jun <chenjun14@huawei.com>

Signed-off-by: John Stultz <john.stultz@linaro.org>

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>

---
 arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
index c25fff9..7aac35b 100644
--- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
+++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
@@ -10,6 +10,8 @@ 
 #include "hi3660.dtsi"
 #include "hikey960-pinctrl.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
 	model = "HiKey960";
@@ -34,6 +36,19 @@ 
 		/* rewrite this at bootloader */
 		reg = <0x0 0x0 0x0 0x0>;
 	};
+
+	keys {
+		compatible = "gpio-keys";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pwr_key_pmx_func &pwr_key_cfg_func>;
+
+		power {
+			wakeup-source;
+			gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
+			label = "GPIO Power";
+			linux,code = <KEY_POWER>;
+		};
+	};
 };
 
 &i2c0 {