suspend-usb-device icon indicating copy to clipboard operation
suspend-usb-device copied to clipboard

suspend no longer supported

Open Thermionix opened this issue 13 years ago • 1 comments

I'm using ubuntu 11.04 and found the the echo suspend line didn't work.

I searched and found; https://bbs.archlinux.org/viewtopic.php?id=95659 - In kernels up to 2.6.32, you could also specify "suspend", meaning that the device should remain suspended and autoresume was not allowed. This setting is no longer supported.

solution - replace suspend with; echo "0" > "/sys/bus/usb/devices/$port/power/autosuspend" echo "auto" > "/sys/bus/usb/devices/$port/power/level"

Thermionix avatar May 16 '11 02:05 Thermionix

--- suspend-usb-device.txt  2011-05-16 11:57:52.480936801 +1000
+++ suspend-usb-device.sh   2011-05-16 11:59:25.370936790 +1000
@@ -160,6 +160,7 @@

     # check if CONFIG_USB_SUSPEND is enabled
     [[ $VERBOSE == 1 ]] && echo "Checking whether $DEVICE can be suspended"
+    AUTOSUSPEND_FILE=/sys${DEVICE}/power/autosuspend
     POWER_LEVEL_FILE=/sys${DEVICE}/power/level
     if [ ! -f "$POWER_LEVEL_FILE" ]; then
         1>&2 cat<<EOF
@@ -177,5 +178,6 @@
     fi

     [[ $VERBOSE == 1 ]] && echo "Suspending $DEVICE by writing to $POWER_LEVEL_FILE"
-    echo 'suspend' > "$POWER_LEVEL_FILE"
+    echo "0" > "$AUTOSUSPEND_FILE"
+    echo "auto" > "$POWER_LEVEL_FILE"
 fi

Thermionix avatar May 16 '11 02:05 Thermionix