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.
This commit is contained in:
@@ -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"
|
||||
@@ -1,6 +1,7 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1+
|
||||
|
||||
rules = files('''
|
||||
60-autosuspend.rules
|
||||
60-block.rules
|
||||
60-cdrom_id.rules
|
||||
60-drm.rules
|
||||
|
||||
Reference in New Issue
Block a user