Hi @JohnRH ,
Please note, there is no such thing as a ‘standard’ device tree. To remove SODIMM-45 as a wake-up source on the toradex_6.6-2.0.x-imx
branch, you can simply delete the entire key-wakeup
node.
In the pinmuxing definition like MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01
, the SNVS_TAMPER1
defines the pad, and GPIO5_IO01
represents one of the possible functions of that pad (in this case, only the GPIO function is available for this pin). Therefore, in Toradex Linux, SODIMM-45 was never defined as a TAMPER pin, but rather as GPIO.
You can review other pad definitions here .
After that, you need to configure the pin MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01
as a GPIO input and associate it with a key event that triggers the shutdown. For example
gpio_keys {
compatible = “gpio-keys”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_snvs_gpiokeys>;
status = “okay”;
poweroff_key: button@0 {
label = "Power Off Button";
linux,code = <KEY_POWER>;
gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>; /* GPIO5_IO01 */
debounce-interval = <10>;
linux,input-type = <1>;
};
};
Make sure the following options are enabled in your kernel configuration :
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_GPIO_POLLED=y
When the GPIO state changes (e.g., when the button is pressed and the GPIO goes low), the gpio-keys
driver will generate a KEY_POWER
event. By default, Linux will interpret this as a shutdown event.
You can verify this behavior using:
cat /dev/input/eventX
If you want to configure a custom action when the GPIO state changes (e.g., triggering a shutdown), you can create a custom udev
rule
.