On Thu, 27 Jan 2005, Mohan wrote: > Hello All, > > I had a question abt the "suspend" state in USB. It is known from the > USB specifications that when there is inactivity on the USB bus for 3ms > the device is put in Suspended State. > Can I from the application put the USB device in the suspended state on > inactivity. (say there is no activity for 3mins). This i want to do to > conserve power.
If CONFIG_USB_SUSPEND is set in your kernel configuration then applications can suspend and resume USB devices. Detecting the absence of activity is up to you though; right now the kernel does not have any way to say "Suspend this device after 3 minutes of inactivity". Writing a '3' (with no newline) to <device's sysfs directory>/power/state will suspend the device, and writing a '0' will resume it. For example, you can do echo -n 3 >/sys/bus/usb/devices/1-2/power/state to suspend the device plugged in to port 2 of bus 1. (This requires root privileges, by the way.) Note that this method is likely to change in the future. There ought to be ioctls in usbfs for suspending and resuming devices, but there aren't. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel