Using PWR_BUT power button for wake up


I am using a Beaglebone Black PCB Rev. B6 with a Debian image and Linux 4.4 branch of kernel here

debian@beaglebone:~$ uname -a
Linux beaglebone 4.4.110+ #7 SMP Wed Jul 25 08:50:52 IST 2018 armv7l GNU/Linux

debian@beaglebone:~$ cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 9 (stretch)”
NAME=“Debian GNU/Linux”
VERSION=“9 (stretch)”

Is it possible to use the PWR_BUT power button next to the Ethernet connector for wakeup, when bone has been
put to sleep with

echo mem > /sys/power/state

The default behavior is to shut down since on an interrupt, KEY_POWER event is generated based
on the code here.

I changed this to KEY_WAKEUP without success.

Also came across the following mailing list discussion as referenced in the device tree file

As per the dmesg logs, rtc-only or putting the PMIC in sleep state seems to be not permitted.

Any information as to whether PWR_BUT can be configured for wake up?


It seems this works on 4.14 kernel but the behavior does not make sense.

If I do not deploy the kernel modules, the system wakes up from suspend when power button is pressed.
However, if I deploy the kernel modules, it goes to shutdown on pressing power button. Not sure which
deployed module is changing this behavior.

Trying to backport the wakeup related calls in the tps65217 driver seems to not work for 4.4. Not sure what more is
required. The IRQ domain stuff in 4.14 version of the driver is new to me.