-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Allow device tree devices to make use of 60-evdev.rules #32362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Device tree devices can't match via dmi modalias. The corresponding thing there is the DT compatbile. Allow to match by the most specific part of the device tree compatible. This allows to e.g. match the volume keys on a Librem 5 like: evdev:name:gpio-keys:dt:purism,librem5* matching on a specific model would look like evdev:name:gpio-keys:dt:purism,librem5r4
|
lgtm, but the test suite needs some updating: |
|
Thanks for having a look. Tests will pass once #32261 landed. I'll rebase then. |
|
I've removed the bits that depend on #32261 and undrafted. |
|
hmm, i'd prefer if this is merged with at least one matching entry in in hwdb. I think it might make sense to just add this as an additional commit to #32261 and merge it together. |
|
I couldn't make an entry up that is really needed atm but without this 60-evdev.rules is about impossible to use on DT based devices. Having that in would allow us to explore #32261 further out of tree and then come up with more use cases. |
In #32261 (comment) I mentioned that rules and hwdb have a "contract" and for your case that is basically down to the hwdb lookup method. So you can have this: (Apologies for any typos 😄) So basically: have a udev rule (which can be a near-duplicate of 60-evdev.rules) that does things the way you want to. In this case I just renamed Really, neither udev nor the hwdb care about the content of the match string or how it's composed, it's a simple "build this string" and "lookup this string as key" with the only special behaviour being the If you want a udev rule that calls So while the addition to |
Switching the lookup |
On phones and tablets the only key that should usually unidle a device is the power button while other exposed hardware keys like the volume buttons shouldn't e.g. take the device out of idle / unblank the screen. Allow to specify whether an input device has wakeup keys (default is 1) and to specify whether individual keys on that device are wakeup keys or not. E.g. gmobile:… GM_WAKEUP_KEY_DEFAULT=0 GM_WAKEUP_KEY_116=1 would mark all keys on the matching input device as non-wakeup keys with the exception of the power button. This would be a typical setting for phones. Whereas on a convertible that has a single keyboard device containing both the exposed volume keys as well as the regular input keys gmobile:… GM_WAKEUP_KEY_114=0 GM_WAKEUP_KEY_115=0 would allow all keys to unidle the device except for the exposed volume rocker. See systemd/systemd#32261 for details Device tree devices can't match via dmi modalias. The corresponding thing there is the DT compatible. Allow to match by the most specific part of the device tree compatible. This allows to e.g. match the volume keys on a Librem 5 like: gmobile:name:gpio-keys:dt:purism,librem5* matching on a specific model would look like gmobile:name:gpio-keys:dt:purism,librem5r4 See systemd/systemd#32362 for details Part-of: <https://gitlab.gnome.org/World/Phosh/gmobile/-/merge_requests/41>
Device tree devices currently have some issues using hwdb since they can't use
dmi/id. The corresponding thing in DT is thecompatibleof the root node. Add a udev rule to make use of this and as example add the Librem 5's wakup keys to ignore (so this depends on #32261 .I've split this out as the to get feedback on adding match by device tree compatible. This could be useful for lots of things that so far needed DT changes to export properties relevant for userspace only.