[systemd-devel] [PATCH] logind: add standard gpio power button support

2015-07-31 Thread Kefeng Wang
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==

Signed-off-by: Kefeng Wang wangkefeng.w...@huawei.com
---
 src/login/70-power-switch.rules |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
index 695d246..9299738 100644
--- a/src/login/70-power-switch.rules
+++ b/src/login/70-power-switch.rules
@@ -11,5 +11,6 @@ SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==acpi, 
TAG+=power-switch
 SUBSYSTEM==input, KERNEL==event*, KERNELS==thinkpad_acpi, 
TAG+=power-switch
 SUBSYSTEM==input, KERNEL==event*, ATTRS{name}==twl4030_pwrbutton, 
TAG+=power-switch
 SUBSYSTEM==input, KERNEL==event*, ATTRS{name}==tps65217_pwr_but, 
TAG+=power-switch
+SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==platform, 
ATTRS{keys}==116, TAG+=power-switch
 
 LABEL=power_switch_end
-- 
1.7.1


___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] logind: add standard gpio power button support

2015-07-31 Thread Lennart Poettering
On Fri, 31.07.15 17:51, Kefeng Wang (wangkefeng.w...@huawei.com) wrote:

   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==
 
 Signed-off-by: Kefeng Wang wangkefeng.w...@huawei.com

We do not do S-o-b on systemd. Please do not include this line in
your pacthes.

 ---
  src/login/70-power-switch.rules |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
 index 695d246..9299738 100644
 --- a/src/login/70-power-switch.rules
 +++ b/src/login/70-power-switch.rules
 @@ -11,5 +11,6 @@ SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==acpi, 
 TAG+=power-switch
  SUBSYSTEM==input, KERNEL==event*, KERNELS==thinkpad_acpi, 
 TAG+=power-switch
  SUBSYSTEM==input, KERNEL==event*, ATTRS{name}==twl4030_pwrbutton, 
 TAG+=power-switch
  SUBSYSTEM==input, KERNEL==event*, ATTRS{name}==tps65217_pwr_but, 
 TAG+=power-switch
 +SUBSYSTEM==input, KERNEL==event*, SUBSYSTEMS==platform, 
 ATTRS{keys}==116, TAG+=power-switch

I am pretty sure this should include a DRIVERS==gpio-keys check,
since only then the keys attribute really makes sense.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] logind: add standard gpio power button support

2015-07-31 Thread systemd github import bot
Patchset imported to github.
To create a pull request, one of the main developers has to initiate one via:
https://github.com/systemd/systemd/compare/master...systemd-mailing-devs:1438336274-9992-1-git-send-email-wangkefeng.wang%40huawei.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel