[yocto] Power button not shutting down the OS

Paul Knopf pknopf at medxchange.com
Tue Aug 9 12:51:53 PDT 2016


Hey guys,

I am having an issue with trying to get my power button (i.MX6) to shutdown
the OS.

My kernel has no configuration options for acpi, and acpid gives me the
following error:

-------
root at seco-uq7-dl-256mbx4:~# /usr/sbin/acpid
RTNETLINK1 answers: No such file or directory
acpid: error talking to the kernel via netlink
-------

So, my guess is that I have to use udev. If I use udevadm monitor, no
events get raised when I press the power switch.

After digging through the kernel source code (Linux seco-uq7-dl-256mbx4
3.0.101 #1 SMP PREEMPT Thu Jun 2 10:49:45 PDT 2016 armv7l GNU/Linux) and
the imx6 drivers, I finally found something that may help me.

1. I found the power button driver in the OS at
/sys/bus/platform/drivers/imx_seco_pwrb.

2. Some more info that may be helpful.

root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/power_button/enable
disable
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/power_button/en_flash
disable
root at seco-uq7-dl-256mbx4:~# ls /sys/bus/platform/drivers/imx_seco_pwrb/
bind    uevent  unbind
3. I found /proc/ectrl/events/event_state/power_button which stores the
current state of the power button.

root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
active
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
active
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
active
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
inactive
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
inactive
root at seco-uq7-dl-256mbx4:~# cat /proc/ectrl/events/event_state/power_button
inactive
My embedded operating system is using sysvinit, if that helps.

I effectively need the power button to perform a shutdown -h now. Any ideas
why it isn't currently?

Thanks,
Paul Knopf
Software Engineer
Med X Change, Inc
pknopf at medxchange.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160809/45b40404/attachment.html>


More information about the yocto mailing list