]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
authorJulien Massot <julien.massot@collabora.com>
Fri, 5 Sep 2025 11:51:59 +0000 (13:51 +0200)
committerMatthias Brugger <matthias.bgg@gmail.com>
Tue, 9 Sep 2025 12:46:45 +0000 (14:46 +0200)
Add support for PMIC and GPIO keys on the Radxa NIO 12L board:
Declare a gpio-keys node for the Volume Up button using GPIO106.
Add the corresponding pin configuration in the pinctrl node.
Add a mediatek,mt6359-keys subnode under the PMIC to handle the
power and home buttons exposed by the MT6359.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Julien Massot <julien.massot@collabora.com>
Link: https://lore.kernel.org/r/20250905-radxa-nio-12-l-gpio-v3-2-40f11377fb55@collabora.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts

index 4cbd78c126f6b56f1833d220f7a7fbc7e4320cbb..d32f973f5e0528bc3233ff01f029006dbe6ef894 100644 (file)
@@ -8,6 +8,7 @@
 #include "mt8195.dtsi"
 #include "mt6359.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
 #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
                status = "disabled";
        };
 
+       keys: gpio-keys {
+               compatible = "gpio-keys";
+
+               button-volume-up {
+                       wakeup-source;
+                       debounce-interval = <100>;
+                       gpios = <&pio 106 GPIO_ACTIVE_LOW>;
+                       label = "volume_up";
+                       linux,code = <KEY_VOLUMEUP>;
+               };
+       };
+
        wifi_vreg: regulator-wifi-3v3-en {
                compatible = "regulator-fixed";
                regulator-name = "wifi_3v3_en";
                };
        };
 
+       gpio_key_pins: gpio-keys-pins {
+               pins {
+                       pinmux = <PINMUX_GPIO106__FUNC_GPIO106>;
+                       bias-pull-up;
+                       input-enable;
+               };
+       };
+
        i2c2_pins: i2c2-pins {
                pins-bus {
                        pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
 
 &pmic {
        interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+
+       mt6359keys: keys {
+               compatible = "mediatek,mt6359-keys";
+               mediatek,long-press-mode = <1>;
+               power-off-time-sec = <0>;
+
+               power-key {
+                       linux,keycodes = <KEY_POWER>;
+                       wakeup-source;
+               };
+
+               home {
+                       linux,keycodes = <KEY_HOME>;
+               };
+       };
 };
 
 &scp {