diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-06-13 17:52:41 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-06-22 14:45:20 +0200 |
commit | 79dc5d35dd7eb372afeb638cc1f86d1da2045623 (patch) | |
tree | 0922d1a0e9f99dd01e9fc1d0478ea4fbf611f11d /rules.d/60-autosuspend.rules | |
parent | udev: do not execute hwdb builtin import twice or thrice (diff) | |
download | systemd-79dc5d35dd7eb372afeb638cc1f86d1da2045623.tar.xz systemd-79dc5d35dd7eb372afeb638cc1f86d1da2045623.zip |
tools: rewrite make-autosuspend-rules.py and add udev rules
Concatenating strings is not a very efficient approach. And in this case fully
unnecessary. We also need some rules to make use of those hwdb entries.
PCI needs to be 8 characters, not 4. And we need to use uppercase hexadecimal
for both. With udev rules this made no difference, but hwdb match is case
sensitive.
Fixes #16119.
Diffstat (limited to 'rules.d/60-autosuspend.rules')
-rw-r--r-- | rules.d/60-autosuspend.rules | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rules.d/60-autosuspend.rules b/rules.d/60-autosuspend.rules new file mode 100644 index 0000000000..1f9ebef631 --- /dev/null +++ b/rules.d/60-autosuspend.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="autosuspend_end" + +# I2C rules +SUBSYSTEM=="i2c", ATTR{name}=="cyapa", \ + ATTR{power/control}="on", GOTO="autosuspend_end" + +# Enable autosuspend if hwdb says so. Here we are relying on +# the hwdb import done earlier based on MODALIAS. +ENV{ID_AUTOSUSPEND}=="1", TEST=="power/control", \ + ATTR{power/control}="auto" + +LABEL="autosuspend_end" |