You are not logged in.

#1 2010-04-19 23:20:49

Floft
Member
Registered: 2009-11-15
Posts: 43

Suspending USB Device [SOLVED]

I had 2.6.32 a while ago and wrote a script that allowed me to turn a certian usb device on and off (I used my usb mouse as a demo). When I upgraded to 2.6.33, the way I was doing this stopped working. I was using this (with $port being something like "4-1;" I determine the port by looking at the "product" files in all of the directories in /sys/bus/usb/devices/):

echo suspend > /sys/bus/usb/devices/$port/power/level

echo-ing "on" works fine on both 32 and 33, but when I echo "suspend" (or anything else... like "cows are awesome") on 33 it returns:

bash: echo: write error: Invalid argument

Is there any documentation somewhere that will tell me what the valid values are? I have searched around and haven't been able to find any docs. I have found a few people talking about it, but nowhere have I found a list of valid stuff. I don't exactly want to try browsing through the kernel source code trying to find it... but I guess that is always a last resort.

Edit: On http://www.mjmwired.net/kernel/Document … nt.txt#125 it said:

(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.)

How am I supposed to manually suspend a usb device?

Solution:

echo "0" > "/sys/bus/usb/devices/$port/power/autosuspend"
echo "auto" > "/sys/bus/usb/devices/$port/power/level"

Garrett

Last edited by Floft (2010-04-20 00:10:20)

Offline

Board footer

Powered by FluxBB