1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
systemd/src
Kefeng Wang 405e116f57 logind: add standard gpio power button support
Many boards like hisilicon D02 board use standard gpio key to power down system.
A description of gpio-key in dts shown below,

gpio_keys {
	compatible = "gpio-keys";
	#address-cells = <1>;
	#size-cells = <0>;

	pwrbutton {
		label = "Power Button";
		gpios = <&porta 8 1>;
		linux,code = <116>;  // KEY_POWER, used by SC System Power Down
	};
};

-bash-4.3# udevadm info -a /dev/input/event3

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/gpio_keys/input/input3/event3':
    KERNEL=="event3"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/platform/gpio_keys/input/input3':
    KERNELS=="input3"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="gpio_keys"
    ATTRS{phys}=="gpio-keys/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/platform/gpio_keys':
    KERNELS=="gpio_keys"
    SUBSYSTEMS=="platform"
    DRIVERS=="gpio-keys"
    ATTRS{keys}=="116"
    ATTRS{switches}==""
    ATTRS{driver_override}=="(null)"
    ATTRS{disabled_keys}==""
    ATTRS{disabled_switches}==""

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
2015-08-03 04:04:27 +02:00
..
ac-power treewide: no need to negate errno for log_*_errno() 2014-11-28 13:29:21 +01:00
activate tree-wide: whenever we fork off a foreign child process reset signal mask/handlers 2015-06-10 01:28:58 +02:00
analyze analyze: correctly draw the plot for user instances 2015-07-28 01:16:24 +03:00
ask-password remove unused includes 2015-02-23 23:53:42 +01:00
backlight fileio: consolidate write_string_file*() 2015-07-06 19:19:25 -04:00
basic Merge pull request #814 from dvdhrm/mfree 2015-07-31 20:17:33 +02:00
binfmt tree-wide: fix write_string_file() user that should not create files 2015-07-06 19:27:20 -04:00
boot systemd-boot: sort /EFI/Linux/*.efi files 2015-07-30 18:28:02 +02:00
bootchart bootchart: fix negative 'timeleft' condition 2015-07-21 18:37:06 +02:00
bus-proxyd tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
cgls cgls: machines can also be services 2015-07-22 17:53:14 -04:00
cgroups-agent sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
cgtop cgtop: include missing signal.h for sigwinch 2015-07-17 10:39:06 +02:00
compat-libs #pragma once here and there 2015-01-23 09:30:44 -05:00
core tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
cryptsetup tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
dbus1-generator bus: don't switch to kdbus if not requested 2015-05-06 18:21:51 +02:00
debug-generator core: rework unit name validation and manipulation logic 2015-05-05 15:06:42 -07:00
delta tree-wide: whenever we fork off a foreign child process reset signal mask/handlers 2015-06-10 01:28:58 +02:00
detect-virt remove unused includes 2015-02-23 23:53:42 +01:00
escape escape: fix exit code 2015-07-01 23:46:42 -07:00
firstboot tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
fsck sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
fstab-generator swap: use swapon -o 2015-05-25 17:06:15 +02:00
getty-generator core: rework unit name validation and manipulation logic 2015-05-05 15:06:42 -07:00
gpt-auto-generator tree-wide: use free_and_strdup() 2015-07-30 13:09:01 +02:00
hibernate-resume fileio: consolidate write_string_file*() 2015-07-06 19:19:25 -04:00
hostname sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
hwdb Revert "hwdb: actually search /run/udev/hwdb.d" 2015-06-09 11:26:06 +02:00
import tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
initctl shared: add formats-util.h 2015-04-10 23:54:48 +02:00
journal tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
journal-remote tree-wide: port everything over to fflush_and_check() 2015-07-29 20:31:07 +02:00
kernel-install 90-loaderentry.install: fixup BOOT_OPTIONS 2015-06-02 16:10:06 +02:00
libsystemd sd-bus: cleanup bus_reset_parsed_address() 2015-08-02 23:12:08 +09:00
libsystemd-network tree-wide: port everything over to fflush_and_check() 2015-07-29 20:31:07 +02:00
libudev libudev: device - fix typo in udev_device_get_sysattr_list_entry() 2015-06-17 22:03:34 +02:00
locale tree-wide: port everything over to fflush_and_check() 2015-07-29 20:31:07 +02:00
login logind: add standard gpio power button support 2015-08-03 04:04:27 +02:00
machine tree-wide: port everything over to fflush_and_check() 2015-07-29 20:31:07 +02:00
machine-id-commit machine-id-commit: simplifications 2015-03-10 18:56:56 +01:00
machine-id-setup remove unused includes 2015-02-23 23:53:42 +01:00
modules-load modules-load: fix memory leak 2015-05-13 14:07:26 +02:00
network tree-wide: use free_and_strdup() 2015-07-30 13:09:01 +02:00
notify shared: add formats-util.h 2015-04-10 23:54:48 +02:00
nspawn tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
nss-myhostname tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
nss-mymachines nss-mymachines: map userns users of containers to real user names 2015-07-09 14:46:20 -03:00
nss-resolve sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
path tree-wide: there is no ENOTSUP on linux 2015-03-13 14:10:39 +01:00
quotacheck tree-wide: whenever we fork off a foreign child process reset signal mask/handlers 2015-06-10 01:28:58 +02:00
random-seed random-seed: minor cleanups, in particular when it comes to logging 2015-04-21 18:08:09 +02:00
rc-local-generator treewide: use log_*_errno whenever %m is in the format string 2014-11-28 19:49:27 +01:00
remount-fs tree-wide: whenever we fork off a foreign child process reset signal mask/handlers 2015-06-10 01:28:58 +02:00
reply-password remove unused includes 2015-02-23 23:53:42 +01:00
resolve Merge pull request #768 from poettering/resolved-localhost 2015-07-29 12:44:22 +02:00
resolve-host resolve-host: enable dbus-activation 2015-07-09 11:47:43 +02:00
rfkill fileio: consolidate write_string_file*() 2015-07-06 19:19:25 -04:00
run tree-wide: use free_and_strdup() 2015-07-30 13:09:01 +02:00
shared tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
sleep fileio: consolidate write_string_file*() 2015-07-06 19:19:25 -04:00
socket-proxy remove unused includes 2015-02-23 23:53:42 +01:00
sysctl sysctl: don't propagate ENOENT sysctl options 2015-04-24 19:56:47 +02:00
system-update-generator remove unused includes 2015-02-23 23:53:42 +01:00
systemctl tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
systemd sd-netlink: introduce api for new NL type NLA_FLAG 2015-07-29 11:59:16 +05:30
sysusers tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
sysv-generator sysv-generator: fix coding-style 2015-07-01 13:02:58 +02:00
test Merge pull request #812 from zonque/test 2015-07-31 20:23:19 +02:00
timedate sd-bus: introduce new sd_bus_flush_close_unref() call 2015-07-03 19:49:03 +02:00
timesync timesyncd: remove RLIMIT_NPROC 2015-07-31 15:33:49 +02:00
tmpfiles tmpfiles: downgrade errors when a file system does not support file attributes 2015-07-22 22:02:14 +02:00
tty-ask-password-agent tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
udev tree-wide: introduce mfree() 2015-07-31 19:56:38 +02:00
update-done update-done: ignore nanosecond file timestamp components, they are not reliable 2015-04-27 17:25:57 +02:00
update-utmp shared: add formats-util.h 2015-04-10 23:54:48 +02:00
user-sessions user-sessions: fix write_string_file() fallout 2015-07-21 15:59:02 +02:00
vconsole tree-wide: fix write_string_file() user that should not create files 2015-07-06 19:27:20 -04:00
.gitignore
Makefile