Commit graph

9 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek d9215cd838 Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
Lennart Poettering 5b987a4e3e logind: relax udev rules matching devices logind watches for
Now that we have support for key/switch masking in logind, we can relax
the rules by which logind picks the devices to watch a bit, after all we
won't wake up anymore for every single event, but instead only the
events we actually care about.

This should make power/suspend keys on normal usb/atkbd keyboards just
work.
2017-06-27 19:25:46 +02:00
doubleodoug fc4049c1ab login: support more than just power-gpio-key
Adding additional keys prevents this gpio-keys powerswitch from working,
e.g. this wouldn't poweroff:

button@23 {
    label = "power-switch";
    linux,code = <116>;
    gpios = <&gpio 23 1>;
};
button@25 {
    label = "KEY_A";
    linux,code = <30>;
    gpios = <&gpio 25 1>;
};

Changing ATTRS{keys}=="116" to ATTRS{keys}=="*116*" makes the
power-switch and the A key both work properly.

(David: rephrase and merge-commits)
2015-09-22 16:18:17 +02:00
Martin Pitt 7577e5181a logind: Listen to WMI hotkeys to catch SW_DOCK state/events
On Dell and HP laptops the dock state/events (SW_DOCK) come from the "{Dell,HP}
WMI hotkeys" input devices. Tag them as power-switch so that login actually
considers them. Use a general match in case this affects other vendors, too.

Thanks to Andreas Schultz for debugging this!

https://launchpad.net/bugs/1450009
2015-09-01 10:51:15 +02:00
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
Koen Kooi 492d7a3038 logind: add support for TPS65217 Power Button
This PMIC is found on TI AM335x based boards like the beaglebone and
beaglebone black.

root@beaglebone-white:~# udevadm info -a /dev/input/event0

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/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device
'/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="tps65217_pwr_but"
    ATTRS{phys}==""
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024':
    KERNELS=="0-0024"
    SUBSYSTEMS=="i2c"
    DRIVERS=="tps65217"
    ATTRS{name}=="tps65217"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0':
    KERNELS=="i2c-0"
    SUBSYSTEMS=="i2c"
    DRIVERS==""
    ATTRS{name}=="OMAP I2C adapter"

  looking at parent device '/devices/ocp.3/44e0b000.i2c':
    KERNELS=="44e0b000.i2c"
    SUBSYSTEMS=="platform"
    DRIVERS=="omap_i2c"

  looking at parent device '/devices/ocp.3':
    KERNELS=="ocp.3"
    SUBSYSTEMS=="platform"
    DRIVERS==""
2014-09-27 19:29:45 -04:00
Zbigniew Jędrzejewski-Szmek 58d4aabedd logind: add support for Triton2 Power Button
https://bugs.freedesktop.org/show_bug.cgi?id=84201
2014-09-22 22:15:43 -04:00
Tero Roponen 632c2e4123 login: Use the GOTO properly in udev rule
In udev rules the labels must be assigned to GOTO keys with '='.
2012-05-30 18:34:28 +02:00
Lennart Poettering e9d21f2407 logind: add missing files 2012-05-30 15:07:19 +02:00