Using PWR_BUT power button for wake up

Hello,

I am using a Beaglebone Black PCB Rev. B6 with a Debian image and Linux 4.4 branch of kernel here
https://github.com/beagleboard/linux

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_ID=“9”
VERSION=“9 (stretch)”
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“https://www.debian.org/support
BUG_REPORT_URL=“https://bugs.debian.org/

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.
https://github.com/beagleboard/linux/blob/4.4/drivers/mfd/tps65217.c#L182

I changed this to KEY_WAKEUP without success.

Also came across the following mailing list discussion as referenced in the device tree file
https://patchwork.kernel.org/patch/6397221/

As per the dmesg logs, rtc-only or putting the PMIC in sleep state seems to be not permitted.
https://github.com/beagleboard/linux/blob/4.4/drivers/soc/ti/pm33xx.c#L357

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

Hi,

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.

Regards,
Sanchayan.