Button S2 Power not working using Kernel 3.14

Customize a Linux distribution with Yocto Project, at the very end I need to enable the functionality of the Pushbutton S2 to shutdown the plate.

More infos:

uname -ra

Linux XXXXX 3.14.19-yocto-standard #1 PREEMPT Tue Aug 10 17:47:07 BRT 2015 armv7l GNU/Linux

dmesg | grep tps

[ 1.279073] tps65217 0-0024: TPS65217 ID 0xe version 1.2

zcat /proc/config.gz | grep -E ‘TPS65217|MFD_CORE’

CONFIG_MFD_CORE=y
CONFIG_MFD_TPS65217=y
CONFIG_REGULATOR_TPS65217=y

CONFIG_BACKLIGHT_TPS65217 is not set

ls /sys/class/power_supply/

ls /sys/class/rtc/rtc0/

date device max_user_freq power subsystem uevent
dev hctosys name since_epoch time

ls /sys/class/i2c-dev/i2c-0/

dev device name power subsystem uevent

ls /sys/class/i2c-adapter/i2c-0/

0-0024 device name power uevent
delete_device i2c-dev new_device subsystem

i2cdetect -y -r 0

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- UU – -- – -- – -- – -- – -- –
30: – -- – -- 34 – -- – -- – -- – -- – -- –
40: – -- – -- – -- – -- – -- – -- – -- – --
50: 50 – -- – -- – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

Beaglebone black power with Button S2

i2cget -y -f 0 0x24 0XA

0x08

0x08 (01000)

Beaglebone black power with ButtonS2 Pressed

i2cget -y -f 0 0x24 0XA

0x09

0x09 (01001)

In datasheet Pag.52 - 0xA → STATUS

bit1 :
Push
Button status bit
0 – Push Button is inactive (PB_IN is pulled high)
1 – PushButton is active (PB_IN is pulled low)

I should change the device tree reference in Power PMIC that the Yocto generate? Or create patch for driver tps65217? The same dispatch IRQ?

Someone has already implemented this with Power S2 to halt board?

Double check your systemd settings:

https://github.com/RobertCNelson/boot-scripts/blob/master/mods/wheezy-systemd-poweroff.diff

the tp65217 hit mainline systemd around 221...

Regards,

Thanks Robert.

But I’m using sysvinit, and without udev this board.

Other suggestion?

Well....

There was a hack in 3.8 to map the keypress to the KEY_BUTTON

https://github.com/beagleboard/linux/commit/23a12b82250887340a29d94fbabe7346dfeed817

Regards,