-- DTS for gpio wakeup
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright 2022 NXP
*/
#include "imx93-11x11-evk.dts"
/ {
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_keys>;
power {
label = "GPIO Key Power";
linux,code = <KEY_POWER>;
gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
wakeup-source;
debounce-interval = <20>;
interrupt-parent = <&gpio2>;
interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
};
};
};
&iomuxc {
pinctrl_gpio_keys: gpio_keys_grp {
fsl,pins = <
MX93_PAD_GPIO_IO07__GPIO2_IO07 0x31e
>;
};
};
-- testing the switch GPIO
First check if your gpio dts configuration to make it act as a switch works or not
After executing the command - 'evtest /dev/input/event1'
Trigger an interrupt by connecting GPIO2 7 to GND, as soon as you do that, you will receive Event logs such as below:-
-- Verify the interrupt
-- Go to sleep and then connect the GPIO to GND to trigger a wakeup, in the logs we see that kernel exits the suspend mode