Discussion:
[PATCH 1/2] logind: add support for TPS65217 Power Button
(too old to reply)
Koen Kooi
2014-09-27 07:55:44 UTC
Permalink
Raw Message
This PMIC is found on TI AM335x based boards like the beaglebone and
beaglebone black.

***@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==""
---
src/login/70-power-switch.rules | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
index a6997f7..695d246 100644
--- a/src/login/70-power-switch.rules
+++ b/src/login/70-power-switch.rules
@@ -10,5 +10,6 @@ ACTION=="remove", GOTO="power_switch_end"
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"

LABEL="power_switch_end"
--
1.9.0
Koen Kooi
2014-09-27 07:55:45 UTC
Permalink
Raw Message
This might be too broad since it will listen on *all* gpio-keys based
input devices for a power button press, but such is life.

***@arietta-g25:~# 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/keys/input/input0/event0':
KERNEL=="event0"
SUBSYSTEM=="input"
DRIVER==""

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

looking at parent device '/devices/keys':
KERNELS=="keys"
SUBSYSTEMS=="platform"
DRIVERS=="gpio-keys"
ATTRS{keys}=="116"
ATTRS{switches}==""
ATTRS{driver_override}=="(null)"
ATTRS{disabled_keys}==""
ATTRS{disabled_switches}==""
---
src/login/70-power-switch.rules | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
index 695d246..7bbe096 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*", ATTRS{name}=="keys", TAG+="power-switch"

LABEL="power_switch_end"
--
1.9.0
Zbigniew Jędrzejewski-Szmek
2014-09-27 23:32:01 UTC
Permalink
Raw Message
Hi,

I'll merge 1/2 for now. As for 2/2, let's see what others say.

Zbyszek


On Sat, Sep 27, 2014 at 09:55:45AM +0200, Koen Kooi wrote:
> This might be too broad since it will listen on *all* gpio-keys based
> input devices for a power button press, but such is life.
>
> ***@arietta-g25:~# 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/keys/input/input0/event0':
> KERNEL=="event0"
> SUBSYSTEM=="input"
> DRIVER==""
>
> looking at parent device '/devices/keys/input/input0':
> KERNELS=="input0"
> SUBSYSTEMS=="input"
> DRIVERS==""
> ATTRS{name}=="keys"
> ATTRS{phys}=="gpio-keys/input0"
> ATTRS{uniq}==""
> ATTRS{properties}=="0"
>
> looking at parent device '/devices/keys':
> KERNELS=="keys"
> SUBSYSTEMS=="platform"
> DRIVERS=="gpio-keys"
> ATTRS{keys}=="116"
> ATTRS{switches}==""
> ATTRS{driver_override}=="(null)"
> ATTRS{disabled_keys}==""
> ATTRS{disabled_switches}==""
> ---
> src/login/70-power-switch.rules | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
> index 695d246..7bbe096 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*", ATTRS{name}=="keys", TAG+="power-switch"
>
> LABEL="power_switch_end"
> --
> 1.9.0
>
> _______________________________________________
> systemd-devel mailing list
> systemd-***@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
David Herrmann
2014-09-28 10:23:36 UTC
Permalink
Raw Message
Hi

On Sun, Sep 28, 2014 at 1:32 AM, Zbigniew Jędrzejewski-Szmek
<***@in.waw.pl> wrote:
> Hi,
>
> I'll merge 1/2 for now. As for 2/2, let's see what others say.

I'm against putting workarounds into udev just because kernel
maintainers refuse to give any feedback on evdev patches. With proper
evdev event masks, we can just open _any_ evdev device that has
KEY_POWER (and friends) enabled, but get woken up only for events
we're interested in. It would make all these whitelists obsolete.

Initial reaction of Dmitry (in April) was "That is something I had in
mind for a long time, great job!". Since then, I haven't heard a word
about the 4 further resends.. But at least I assume that the
event-masks are a reasonable feature, so I see little reason in
putting workarounds into udev. I just somehow need to figure out how
to get this upstream..

Sorry!
David
Lennart Poettering
2014-10-01 21:52:39 UTC
Permalink
Raw Message
On Sat, 27.09.14 09:55, Koen Kooi (***@dominion.thruhere.net) wrote:

> diff --git a/src/login/70-power-switch.rules b/src/login/70-power-switch.rules
> index a6997f7..695d246 100644
> --- a/src/login/70-power-switch.rules
> +++ b/src/login/70-power-switch.rules
> @@ -10,5 +10,6 @@ ACTION=="remove", GOTO="power_switch_end"
> 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"

If the input masking kernel patch David did won't get applied anytime
soon it might be worth moving these tags to the hwdb, so that we don't
have to list tons of devices explicitly here.

Lennart

--
Lennart Poettering, Red Hat
Loading...