arm64: tegra: Add GPIO keys on P2771
authorThierry Reding <treding@nvidia.com>
Thu, 23 Feb 2017 17:30:51 +0000 (18:30 +0100)
committerThierry Reding <treding@nvidia.com>
Fri, 10 Mar 2017 16:37:35 +0000 (17:37 +0100)
The P2771 has three keys (power, volume up and volume down) that are
connected to pins on the AON GPIO controller.

Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts

index b80c1c3..9a1d022 100644 (file)
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
+
 #include "tegra186-p3310.dtsi"
 
 / {
                vmmc-supply = <&vdd_sd>;
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               power {
+                       label = "Power";
+                       gpios = <&gpio_aon TEGRA_AON_GPIO(FF, 0)
+                                          GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <KEY_POWER>;
+                       debounce-interval = <10>;
+                       wakeup-source;
+               };
+
+               volume-up {
+                       label = "Volume Up";
+                       gpios = <&gpio_aon TEGRA_AON_GPIO(FF, 1)
+                                          GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       debounce-interval = <10>;
+               };
+
+               volume-down {
+                       label = "Volume Down";
+                       gpios = <&gpio_aon TEGRA_AON_GPIO(FF, 2)
+                                          GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_KEY>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       debounce-interval = <10>;
+               };
+       };
+
        regulators {
                vdd_sd: regulator@100 {
                        compatible = "regulator-fixed";