[systemd-bugs] [Bug 82347] New: gpio-controlled shutdown power mechanism

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 8 06:01:28 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=82347

          Priority: medium
            Bug ID: 82347
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: gpio-controlled shutdown power mechanism
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: dannf at dannf.org
          Hardware: ARM
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

There are a couple of ARM-based server systems that use the gpio-keyboard and
gpio-keyboard-polled drivers to send an event requesting a shutdown. The
following rules DTRT, though obviously it'd be nice if a more generic (but
still safe) rule could be devised.

SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform",
KERNELS=="gpio-keys.6", PROGRAM="/bin/grep '^HP ProLiant m400 Server
Cartridge$' /proc/device-tree/model", TAG+="power-switch"


SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform",
KERNELS=="gpio_keys.12", ATTRS{keys}=="116", PROGRAM="/bin/cat
/proc/device-tree/model", RESULT=="HP ProLiant m800 Server Cartridge",
TAG+="power-switch"

You'll notice a couple of differences between the two. The m800 rule specifies
a key attribute where the m400 rule does not. This is because the first uses a
polled gpio via the gpio-keyboard-polled driver. This driver does not expose a
"keys" attribute in sysfs. The m400 uses the gpio-keyboard driver, which does.

You'll also notice the grep vs. cat/RESULT methods. Not sure if upstream has a
preference.

It might make sense to drop the model/pin matching of the m800 rule, and bind
to any ATTR{keys}=="116" - this is defined as KEY_POWER in <linux/input.h>. Of
course, that won't help the -polled variant.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140808/6ba98229/attachment.html>


More information about the systemd-bugs mailing list