From 227c23b5dee1c8cf8147a47b275af3e367a352b1 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Tue, 12 Sep 2017 13:57:54 +0200 Subject: ARM: dts: exynos: Add power button for Odroid XU3/4 The power button (SW2) on Odroid XU3/4 is connected to the PWRON pin of the S2MPS11 PMIC. The S2MPS11 datasheet says that ONOB pin operates as 'PWRON key active low signal'. In fact, S2MPS11 PMIC acts as a 16ms debouce filter and signal inverter, thus effectively repeating PWRON (active high) to ONOB pin (active low). ONOB PMIC pin is then connected to XEINT3 SoC pin, so we get the state of the power button on the gpx0-3 GPIO. This patch adds device-tree bindings for the power button of Odroid XU3/4 boards. Signed-off-by: Brian Kim [mszyprow: extended commit message, added comments and fixed minor issues in the dts] Signed-off-by: Marek Szyprowski Reviewed-by: Anand Moon Tested-by: Anand Moon Signed-off-by: Krzysztof Kozlowski --- arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi index 0418f20d9f5b..7d2b95c6970f 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi @@ -13,6 +13,7 @@ */ #include +#include #include #include #include @@ -41,6 +42,27 @@ }; }; + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&power_key>; + + power_key { + /* + * The power button (SW2) is connected to the PWRON + * pin (active high) of the S2MPS11 PMIC, which acts + * as a 16ms debouce filter and signal inverter with + * output on ONOB pin (active low). ONOB PMIC pin is + * then connected to XEINT3 SoC pin. + */ + gpios = <&gpx0 3 GPIO_ACTIVE_LOW>; + linux,code = ; + label = "power key"; + debounce-interval = <0>; + wakeup-source; + }; + }; + emmc_pwrseq: pwrseq { pinctrl-0 = <&emmc_nrst_pin>; pinctrl-names = "default"; @@ -760,6 +782,13 @@ }; &pinctrl_0 { + power_key: power-key { + samsung,pins = "gpx0-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + hdmi_hpd_irq: hdmi-hpd-irq { samsung,pins = "gpx3-7"; samsung,pin-function = ; -- cgit v1.2.3