]>
Commit | Line | Data |
---|---|---|
b61d777a ML |
1 | #!/usr/bin/env python3 |
2 | # SPDX-License-Identifier: LGPL-2.1+ | |
3 | ||
7b33ff73 ZJS |
4 | # Generate autosuspend rules for devices that have been tested to work properly |
5 | # with autosuspend by the Chromium OS team. Based on | |
b61d777a ML |
6 | # https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/udev/gen_autosuspend_rules.py |
7 | ||
0490b440 | 8 | import chromiumos.gen_autosuspend_rules |
b61d777a | 9 | |
79dc5d35 ZJS |
10 | print('# pci:v<00VENDOR>d<00DEVICE> (8 uppercase hexadecimal digits twice)') |
11 | for entry in chromiumos.gen_autosuspend_rules.PCI_IDS: | |
12 | vendor, device = entry.split(':') | |
13 | vendor = int(vendor, 16) | |
14 | device = int(device, 16) | |
15 | print(f'pci:v{vendor:08X}d{device:08X}*') | |
16 | ||
17 | print('# usb:v<VEND>p<PROD> (4 uppercase hexadecimal digits twice') | |
18 | for entry in chromiumos.gen_autosuspend_rules.USB_IDS: | |
19 | vendor, product = entry.split(':') | |
20 | vendor = int(vendor, 16) | |
21 | product = int(product, 16) | |
22 | print(f'usb:v{vendor:04X}p{product:04X}*') | |
23 | ||
24 | print(' ID_AUTOSUSPEND=1') |