ipq806x: Add buttons to OnHub
authorAlan Luck <luckyhome2008@gmail.com>
Sun, 26 Feb 2023 06:17:37 +0000 (22:17 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 5 Mar 2023 16:24:46 +0000 (17:24 +0100)
These are the factory reset button (external) and "developer mode"
button (hidden inside the case (ASUS) or under a screw in the base
(TP-Link)) found on the TP-Link and ASUS OnHub devices.

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
[Brian: add description; factor out for both ASUS and TP-Link; use
existing pinmux definitions; add keycode for dev button]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi

index 25ba71da00ef09ff0283174ffac35cdac220c58f..549c46202619b65696da3a4adf72ebf87ebf2c11 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "qcom-ipq8064-smb208.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/soc/qcom,tcsr.h>
 
 / {
                };
        };
 
+       keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&button_pins>;
+               pinctrl-names = "default";
+
+               reset {
+                       label = "reset";
+                       gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+                       debounce-interval = <60>;
+                       wakeup-source;
+               };
+
+               dev {
+                       label = "dev";
+                       gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_CONFIG>;
+                       debounce-interval = <60>;
+                       wakeup-source;
+               };
+       };
+
        mdio: mdio {
                compatible = "virtual,mdio-gpio";
                #address-cells = <1>;
                        pins = "gpio17";
                        output-low;
                };
+       };
+
+       button_pins: button_pins {
                recovery {
                        pins = "gpio16";
+                       function = "gpio";
                        bias-none;
                };
                developer {
                        pins = "gpio15";
+                       function = "gpio";
                        bias-none;
                };
        };