I want to use a button (SODIMM 55) as both wakeup source and input. I have modified the device tree as follows:
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_snvs_gpiokeys>;
power {
label = "Wake-Up";
gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>; // SODIMM 45
linux,code = <KEY_WAKEUP>;
debounce-interval = <10>;
gpio-key,wakeup;
};
wakeup {
label = "Wake-Up_BTN";
gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; // SODIMM 55
linux,code = <KEY_WAKEUP>;
debounce-interval = <10>;
gpio-key,wakeup;
};
};
&iomuxc {
imx6ull-colibri {
pinctrl_misc_gpio: misc-gpio-grp {
fsl,pins = <
MX6UL_PAD_ENET1_RX_DATA0__GPIO2_IO00 0x28 // SODIMM 55; general button
>;
};
};
};
It works fine (the system wakes up from standby/suspend when pressing the button). But if I try to access the the pin with gpioget 1 0
, it says the gpioget: error reading GPIO values: Device or resource busy
. Also, gpioinfo
shows that the resource is used:
gpioinfo 1
gpiochip1 - 32 lines:
line 0: "SODIMM_55" "Wake-Up_BTN" input active-high [used]
So, is it possible to use the pin as both wakeup source and input?