]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
riscv: sophgo: dts: add power key for pioneer box
authorChen Wang <unicorn_wang@outlook.com>
Tue, 8 Oct 2024 01:43:52 +0000 (09:43 +0800)
committerInochi Amaoto <inochiama@gmail.com>
Tue, 22 Oct 2024 02:00:31 +0000 (10:00 +0800)
There is a power button on the front panel of the pioneer box.
Short pressing the button will trigger the onboard MCU to
notify SG2042 through GPIO22 to enter the power-off process.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Link: https://lore.kernel.org/r/12e65a99f1b52c52b7372e900a203063b30c74b5.1728350655.git.unicorn_wang@outlook.com
Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts

index a3f9d6f2256659039b45c5e270fc8be674347666..be596d01ff8d33bcdbe431d9731a55ee190ad5b3 100644 (file)
@@ -5,6 +5,9 @@
 
 #include "sg2042.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
 / {
        model = "Milk-V Pioneer";
        compatible = "milkv,pioneer", "sophgo,sg2042";
        chosen {
                stdout-path = "serial0";
        };
+
+       gpio-power {
+               compatible = "gpio-keys";
+
+               key-power {
+                       label = "Power Key";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&port0a 22 GPIO_ACTIVE_HIGH>;
+                       linux,input-type = <EV_KEY>;
+                       debounce-interval = <100>;
+               };
+       };
 };
 
 &cgi_main {