blob: 4affc8ca14e671918717bfbbd1e56a5d5a87afd7 [file] [log] [blame]
--- laptop-mode-tools-1.59/etc/laptop-mode/conf.d/runtime-pm.conf 2011-08-07 12:30:43.000000000 -0700
+++ laptop-mode-tools-1.59/etc/laptop-mode/conf.d/runtime-pm.conf 2012-10-17 16:45:20.311104691 -0700
@@ -25,3 +25,7 @@ CONTROL_RUNTIME_PM="auto"
# Enable debug mode for this module
# Set to 1 if you want to debug this module
DEBUG=0
+
+# The list of devices that should not use Runtime Power Management by name.
+# Example: RUNTIME_PM_NAME_BLACKLIST="isl29018 cyapa"
+RUNTIME_PM_NAME_BLACKLIST=""
--- laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/runtime-pm 2011-08-07 12:30:43.000000000 -0700
+++ laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/runtime-pm 2012-10-17 16:39:27.467105016 -0700
@@ -3,12 +3,33 @@
# Laptop mode tools module: Runtime Power Management
#
+# Check whether a device is listed by name
+listed_by_name() {
+ device=$1
+ list=$2
+ for name in $list; do
+ grep -qi $name $device/name 2>/dev/null\
+ && return 0
+ done
+ return 1
+}
+
+# Checks whether a device is blacklisted by name
+blacklisted() {
+ listed_by_name $1 "$RUNTIME_PM_NAME_BLACKLIST" || return 1
+ return 0
+}
activate_runtime_suspend() {
for device in $1/*; do
if [ -f $device/power/control ]; then
- echo "auto" > $device/power/control;
- log "VERBOSE" "Setting Runtime PM auto for device $device"
+ if ! blacklisted $device; then
+ echo "auto" > $device/power/control;
+ log "VERBOSE" "Setting Runtime PM auto for device $device"
+ else
+ echo "on" > $device/power/control;
+ log "VERBOSE" "Setting on for blacklisted device $device"
+ fi
else
log "VERBOSE" "$device does not support Runtime PM"
fi