1eaafbc3aSAlan SternWhat: /sys/bus/usb/devices/.../power/autosuspend 2eaafbc3aSAlan SternDate: March 2007 3eaafbc3aSAlan SternKernelVersion: 2.6.21 4eaafbc3aSAlan SternContact: Alan Stern <stern@rowland.harvard.edu> 5eaafbc3aSAlan SternDescription: 6eaafbc3aSAlan Stern Each USB device directory will contain a file named 7eaafbc3aSAlan Stern power/autosuspend. This file holds the time (in seconds) 8eaafbc3aSAlan Stern the device must be idle before it will be autosuspended. 9eaafbc3aSAlan Stern 0 means the device will be autosuspended as soon as 10eaafbc3aSAlan Stern possible. Negative values will prevent the device from 11eaafbc3aSAlan Stern being autosuspended at all, and writing a negative value 12eaafbc3aSAlan Stern will resume the device if it is already suspended. 13eaafbc3aSAlan Stern 14eaafbc3aSAlan Stern The autosuspend delay for newly-created devices is set to 15eaafbc3aSAlan Stern the value of the usbcore.autosuspend module parameter. 162add5229SAlan Stern 172add5229SAlan SternWhat: /sys/bus/usb/devices/.../power/level 182add5229SAlan SternDate: March 2007 192add5229SAlan SternKernelVersion: 2.6.21 202add5229SAlan SternContact: Alan Stern <stern@rowland.harvard.edu> 212add5229SAlan SternDescription: 222add5229SAlan Stern Each USB device directory will contain a file named 232add5229SAlan Stern power/level. This file holds a power-level setting for 24baf67741SAlan Stern the device, either "on" or "auto". 252add5229SAlan Stern 262add5229SAlan Stern "on" means that the device is not allowed to autosuspend, 272add5229SAlan Stern although normal suspends for system sleep will still 282add5229SAlan Stern be honored. "auto" means the device will autosuspend 292add5229SAlan Stern and autoresume in the usual manner, according to the 30baf67741SAlan Stern capabilities of its driver. 312add5229SAlan Stern 322add5229SAlan Stern During normal use, devices should be left in the "auto" 33baf67741SAlan Stern level. The "on" level is meant for administrative uses. 342add5229SAlan Stern If you want to suspend a device immediately but leave it 352add5229SAlan Stern free to wake up in response to I/O requests, you should 362add5229SAlan Stern write "0" to power/autosuspend. 37b41a60ecSAlan Stern 38baf67741SAlan Stern Device not capable of proper suspend and resume should be 39baf67741SAlan Stern left in the "on" level. Although the USB spec requires 40baf67741SAlan Stern devices to support suspend/resume, many of them do not. 41baf67741SAlan Stern In fact so many don't that by default, the USB core 42baf67741SAlan Stern initializes all non-hub devices in the "on" level. Some 43baf67741SAlan Stern drivers may change this setting when they are bound. 44baf67741SAlan Stern 45b41a60ecSAlan SternWhat: /sys/bus/usb/devices/.../power/persist 46b41a60ecSAlan SternDate: May 2007 47b41a60ecSAlan SternKernelVersion: 2.6.23 48b41a60ecSAlan SternContact: Alan Stern <stern@rowland.harvard.edu> 49b41a60ecSAlan SternDescription: 50b41a60ecSAlan Stern If CONFIG_USB_PERSIST is set, then each USB device directory 51b41a60ecSAlan Stern will contain a file named power/persist. The file holds a 52b41a60ecSAlan Stern boolean value (0 or 1) indicating whether or not the 53b41a60ecSAlan Stern "USB-Persist" facility is enabled for the device. Since the 54b41a60ecSAlan Stern facility is inherently dangerous, it is disabled by default 55b41a60ecSAlan Stern for all devices except hubs. For more information, see 56b41a60ecSAlan Stern Documentation/usb/persist.txt. 57979e524aSSarah Sharp 58979e524aSSarah SharpWhat: /sys/bus/usb/device/.../power/connected_duration 59979e524aSSarah SharpDate: January 2008 60979e524aSSarah SharpKernelVersion: 2.6.25 61979e524aSSarah SharpContact: Sarah Sharp <sarah.a.sharp@intel.com> 62979e524aSSarah SharpDescription: 63979e524aSSarah Sharp If CONFIG_PM and CONFIG_USB_SUSPEND are enabled, then this file 64979e524aSSarah Sharp is present. When read, it returns the total time (in msec) 65979e524aSSarah Sharp that the USB device has been connected to the machine. This 66979e524aSSarah Sharp file is read-only. 67979e524aSSarah SharpUsers: 68979e524aSSarah Sharp PowerTOP <power@bughost.org> 69979e524aSSarah Sharp http://www.lesswatts.org/projects/powertop/ 70979e524aSSarah Sharp 71979e524aSSarah SharpWhat: /sys/bus/usb/device/.../power/active_duration 72979e524aSSarah SharpDate: January 2008 73979e524aSSarah SharpKernelVersion: 2.6.25 74979e524aSSarah SharpContact: Sarah Sharp <sarah.a.sharp@intel.com> 75979e524aSSarah SharpDescription: 76979e524aSSarah Sharp If CONFIG_PM and CONFIG_USB_SUSPEND are enabled, then this file 77979e524aSSarah Sharp is present. When read, it returns the total time (in msec) 78979e524aSSarah Sharp that the USB device has been active, i.e. not in a suspended 79979e524aSSarah Sharp state. This file is read-only. 80979e524aSSarah Sharp 81979e524aSSarah Sharp Tools can use this file and the connected_duration file to 82979e524aSSarah Sharp compute the percentage of time that a device has been active. 83979e524aSSarah Sharp For example, 84979e524aSSarah Sharp echo $((100 * `cat active_duration` / `cat connected_duration`)) 85979e524aSSarah Sharp will give an integer percentage. Note that this does not 86979e524aSSarah Sharp account for counter wrap. 87979e524aSSarah SharpUsers: 88979e524aSSarah Sharp PowerTOP <power@bughost.org> 89979e524aSSarah Sharp http://www.lesswatts.org/projects/powertop/ 90c8cf2465SDavid Vrabel 9149e7cc84SSarah SharpWhat: /sys/bus/usb/device/<busnum>-<devnum>...:<config num>-<interface num>/supports_autosuspend 9249e7cc84SSarah SharpDate: January 2008 9349e7cc84SSarah SharpKernelVersion: 2.6.27 9449e7cc84SSarah SharpContact: Sarah Sharp <sarah.a.sharp@intel.com> 9549e7cc84SSarah SharpDescription: 9649e7cc84SSarah Sharp When read, this file returns 1 if the interface driver 9749e7cc84SSarah Sharp for this interface supports autosuspend. It also 9849e7cc84SSarah Sharp returns 1 if no driver has claimed this interface, as an 9949e7cc84SSarah Sharp unclaimed interface will not stop the device from being 10049e7cc84SSarah Sharp autosuspended if all other interface drivers are idle. 10149e7cc84SSarah Sharp The file returns 0 if autosuspend support has not been 10249e7cc84SSarah Sharp added to the driver. 10349e7cc84SSarah SharpUsers: 10449e7cc84SSarah Sharp USB PM tool 10549e7cc84SSarah Sharp git://git.moblin.org/users/sarah/usb-pm-tool/ 10661e0e79eSDavid Vrabel 107c8cf2465SDavid VrabelWhat: /sys/bus/usb/device/.../authorized 108c8cf2465SDavid VrabelDate: July 2008 109c8cf2465SDavid VrabelKernelVersion: 2.6.26 110c8cf2465SDavid VrabelContact: David Vrabel <david.vrabel@csr.com> 111c8cf2465SDavid VrabelDescription: 112c8cf2465SDavid Vrabel Authorized devices are available for use by device 113c8cf2465SDavid Vrabel drivers, non-authorized one are not. By default, wired 114c8cf2465SDavid Vrabel USB devices are authorized. 115c8cf2465SDavid Vrabel 116c8cf2465SDavid Vrabel Certified Wireless USB devices are not authorized 117c8cf2465SDavid Vrabel initially and should be (by writing 1) after the 118c8cf2465SDavid Vrabel device has been authenticated. 119c8cf2465SDavid Vrabel 120c8cf2465SDavid VrabelWhat: /sys/bus/usb/device/.../wusb_cdid 121c8cf2465SDavid VrabelDate: July 2008 122c8cf2465SDavid VrabelKernelVersion: 2.6.27 123c8cf2465SDavid VrabelContact: David Vrabel <david.vrabel@csr.com> 124c8cf2465SDavid VrabelDescription: 125c8cf2465SDavid Vrabel For Certified Wireless USB devices only. 126c8cf2465SDavid Vrabel 127c8cf2465SDavid Vrabel A devices's CDID, as 16 space-separated hex octets. 128c8cf2465SDavid Vrabel 129c8cf2465SDavid VrabelWhat: /sys/bus/usb/device/.../wusb_ck 130c8cf2465SDavid VrabelDate: July 2008 131c8cf2465SDavid VrabelKernelVersion: 2.6.27 132c8cf2465SDavid VrabelContact: David Vrabel <david.vrabel@csr.com> 133c8cf2465SDavid VrabelDescription: 134c8cf2465SDavid Vrabel For Certified Wireless USB devices only. 135c8cf2465SDavid Vrabel 136c8cf2465SDavid Vrabel Write the device's connection key (CK) to start the 137c8cf2465SDavid Vrabel authentication of the device. The CK is 16 138c8cf2465SDavid Vrabel space-separated hex octets. 139c8cf2465SDavid Vrabel 140c8cf2465SDavid VrabelWhat: /sys/bus/usb/device/.../wusb_disconnect 141c8cf2465SDavid VrabelDate: July 2008 142c8cf2465SDavid VrabelKernelVersion: 2.6.27 143c8cf2465SDavid VrabelContact: David Vrabel <david.vrabel@csr.com> 144c8cf2465SDavid VrabelDescription: 145c8cf2465SDavid Vrabel For Certified Wireless USB devices only. 146c8cf2465SDavid Vrabel 147c8cf2465SDavid Vrabel Write a 1 to force the device to disconnect 148c8cf2465SDavid Vrabel (equivalent to unplugging a wired USB device). 1490c7a2b72SCHENG Renquan 1500c7a2b72SCHENG RenquanWhat: /sys/bus/usb/drivers/.../remove_id 1510c7a2b72SCHENG RenquanDate: November 2009 1520c7a2b72SCHENG RenquanContact: CHENG Renquan <rqcheng@smu.edu.sg> 1530c7a2b72SCHENG RenquanDescription: 1540c7a2b72SCHENG Renquan Writing a device ID to this file will remove an ID 1550c7a2b72SCHENG Renquan that was dynamically added via the new_id sysfs entry. 1560c7a2b72SCHENG Renquan The format for the device ID is: 1570c7a2b72SCHENG Renquan idVendor idProduct. After successfully 1580c7a2b72SCHENG Renquan removing an ID, the driver will no longer support the 1590c7a2b72SCHENG Renquan device. This is useful to ensure auto probing won't 1600c7a2b72SCHENG Renquan match the driver to the device. For example: 1610c7a2b72SCHENG Renquan # echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id 162ef955341SOliver Neukum 163ef955341SOliver NeukumWhat: /sys/bus/usb/device/.../avoid_reset 164ef955341SOliver NeukumDate: December 2009 165ef955341SOliver NeukumContact: Oliver Neukum <oliver@neukum.org> 166ef955341SOliver NeukumDescription: 167ef955341SOliver Neukum Writing 1 to this file tells the kernel that this 168ef955341SOliver Neukum device will morph into another mode when it is reset. 169ef955341SOliver Neukum Drivers will not use reset for error handling for 170ef955341SOliver Neukum such devices. 171ef955341SOliver NeukumUsers: 172ef955341SOliver Neukum usb_modeswitch 173