11f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../power/persist 21f77fdf7SHans de GoedeDate: May 2007 31f77fdf7SHans de GoedeKernelVersion: 2.6.23 41f77fdf7SHans de GoedeContact: Alan Stern <stern@rowland.harvard.edu> 51f77fdf7SHans de GoedeDescription: 61f77fdf7SHans de Goede If CONFIG_USB_PERSIST is set, then each USB device directory 71f77fdf7SHans de Goede will contain a file named power/persist. The file holds a 81f77fdf7SHans de Goede boolean value (0 or 1) indicating whether or not the 91f77fdf7SHans de Goede "USB-Persist" facility is enabled for the device. Since the 101f77fdf7SHans de Goede facility is inherently dangerous, it is disabled by default 111f77fdf7SHans de Goede for all devices except hubs. For more information, see 121f77fdf7SHans de Goede Documentation/usb/persist.txt. 131f77fdf7SHans de Goede 141f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../power/autosuspend 151f77fdf7SHans de GoedeDate: March 2007 161f77fdf7SHans de GoedeKernelVersion: 2.6.21 171f77fdf7SHans de GoedeContact: Alan Stern <stern@rowland.harvard.edu> 181f77fdf7SHans de GoedeDescription: 191f77fdf7SHans de Goede Each USB device directory will contain a file named 201f77fdf7SHans de Goede power/autosuspend. This file holds the time (in seconds) 211f77fdf7SHans de Goede the device must be idle before it will be autosuspended. 221f77fdf7SHans de Goede 0 means the device will be autosuspended as soon as 231f77fdf7SHans de Goede possible. Negative values will prevent the device from 241f77fdf7SHans de Goede being autosuspended at all, and writing a negative value 251f77fdf7SHans de Goede will resume the device if it is already suspended. 261f77fdf7SHans de Goede 271f77fdf7SHans de Goede The autosuspend delay for newly-created devices is set to 281f77fdf7SHans de Goede the value of the usbcore.autosuspend module parameter. 291f77fdf7SHans de Goede 301f77fdf7SHans de GoedeWhat: /sys/bus/usb/device/.../power/connected_duration 311f77fdf7SHans de GoedeDate: January 2008 321f77fdf7SHans de GoedeKernelVersion: 2.6.25 331f77fdf7SHans de GoedeContact: Sarah Sharp <sarah.a.sharp@intel.com> 341f77fdf7SHans de GoedeDescription: 351f77fdf7SHans de Goede If CONFIG_PM_RUNTIME is enabled then this file 361f77fdf7SHans de Goede is present. When read, it returns the total time (in msec) 371f77fdf7SHans de Goede that the USB device has been connected to the machine. This 381f77fdf7SHans de Goede file is read-only. 391f77fdf7SHans de GoedeUsers: 40*aaf3d29fSRafael J. Wysocki PowerTOP <powertop@lists.01.org> 41*aaf3d29fSRafael J. Wysocki https://01.org/powertop/ 421f77fdf7SHans de Goede 431f77fdf7SHans de GoedeWhat: /sys/bus/usb/device/.../power/active_duration 441f77fdf7SHans de GoedeDate: January 2008 451f77fdf7SHans de GoedeKernelVersion: 2.6.25 461f77fdf7SHans de GoedeContact: Sarah Sharp <sarah.a.sharp@intel.com> 471f77fdf7SHans de GoedeDescription: 481f77fdf7SHans de Goede If CONFIG_PM_RUNTIME is enabled then this file 491f77fdf7SHans de Goede is present. When read, it returns the total time (in msec) 501f77fdf7SHans de Goede that the USB device has been active, i.e. not in a suspended 511f77fdf7SHans de Goede state. This file is read-only. 521f77fdf7SHans de Goede 531f77fdf7SHans de Goede Tools can use this file and the connected_duration file to 541f77fdf7SHans de Goede compute the percentage of time that a device has been active. 551f77fdf7SHans de Goede For example, 561f77fdf7SHans de Goede echo $((100 * `cat active_duration` / `cat connected_duration`)) 571f77fdf7SHans de Goede will give an integer percentage. Note that this does not 581f77fdf7SHans de Goede account for counter wrap. 591f77fdf7SHans de GoedeUsers: 60*aaf3d29fSRafael J. Wysocki PowerTOP <powertop@lists.01.org> 61*aaf3d29fSRafael J. Wysocki https://01.org/powertop/ 621f77fdf7SHans de Goede 631f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend 641f77fdf7SHans de GoedeDate: January 2008 651f77fdf7SHans de GoedeKernelVersion: 2.6.27 661f77fdf7SHans de GoedeContact: Sarah Sharp <sarah.a.sharp@intel.com> 671f77fdf7SHans de GoedeDescription: 681f77fdf7SHans de Goede When read, this file returns 1 if the interface driver 691f77fdf7SHans de Goede for this interface supports autosuspend. It also 701f77fdf7SHans de Goede returns 1 if no driver has claimed this interface, as an 711f77fdf7SHans de Goede unclaimed interface will not stop the device from being 721f77fdf7SHans de Goede autosuspended if all other interface drivers are idle. 731f77fdf7SHans de Goede The file returns 0 if autosuspend support has not been 741f77fdf7SHans de Goede added to the driver. 751f77fdf7SHans de GoedeUsers: 761f77fdf7SHans de Goede USB PM tool 771f77fdf7SHans de Goede git://git.moblin.org/users/sarah/usb-pm-tool/ 781f77fdf7SHans de Goede 791f77fdf7SHans de GoedeWhat: /sys/bus/usb/device/.../avoid_reset_quirk 801f77fdf7SHans de GoedeDate: December 2009 811f77fdf7SHans de GoedeContact: Oliver Neukum <oliver@neukum.org> 821f77fdf7SHans de GoedeDescription: 831f77fdf7SHans de Goede Writing 1 to this file tells the kernel that this 841f77fdf7SHans de Goede device will morph into another mode when it is reset. 851f77fdf7SHans de Goede Drivers will not use reset for error handling for 861f77fdf7SHans de Goede such devices. 871f77fdf7SHans de GoedeUsers: 881f77fdf7SHans de Goede usb_modeswitch 891f77fdf7SHans de Goede 901f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../devnum 911f77fdf7SHans de GoedeKernelVersion: since at least 2.6.18 921f77fdf7SHans de GoedeDescription: 931f77fdf7SHans de Goede Device address on the USB bus. 942eb86032SHans de GoedeUsers: 952eb86032SHans de Goede libusb 961f77fdf7SHans de Goede 971f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../bConfigurationValue 981f77fdf7SHans de GoedeKernelVersion: since at least 2.6.18 991f77fdf7SHans de GoedeDescription: 1001f77fdf7SHans de Goede bConfigurationValue of the *active* configuration for the 1011f77fdf7SHans de Goede device. Writing 0 or -1 to bConfigurationValue will reset the 1021f77fdf7SHans de Goede active configuration (unconfigure the device). Writing 1031f77fdf7SHans de Goede another value will change the active configuration. 1041f77fdf7SHans de Goede 1051f77fdf7SHans de Goede Note that some devices, in violation of the USB spec, have a 1061f77fdf7SHans de Goede configuration with a value equal to 0. Writing 0 to 1071f77fdf7SHans de Goede bConfigurationValue for these devices will install that 1081f77fdf7SHans de Goede configuration, rather then unconfigure the device. 1091f77fdf7SHans de Goede 1101f77fdf7SHans de Goede Writing -1 will always unconfigure the device. 1112eb86032SHans de GoedeUsers: 1122eb86032SHans de Goede libusb 1131f77fdf7SHans de Goede 1141f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../busnum 1151f77fdf7SHans de GoedeKernelVersion: 2.6.22 1161f77fdf7SHans de GoedeDescription: 1171f77fdf7SHans de Goede Bus-number of the USB-bus the device is connected to. 1182eb86032SHans de GoedeUsers: 1192eb86032SHans de Goede libusb 1201f77fdf7SHans de Goede 1211f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../descriptors 1221f77fdf7SHans de GoedeKernelVersion: 2.6.26 1231f77fdf7SHans de GoedeDescription: 1241f77fdf7SHans de Goede Binary file containing cached descriptors of the device. The 1251f77fdf7SHans de Goede binary data consists of the device descriptor followed by the 1261f77fdf7SHans de Goede descriptors for each configuration of the device. 1271f77fdf7SHans de Goede Note that the wTotalLength of the config descriptors can not 1281f77fdf7SHans de Goede be trusted, as the device may have a smaller config descriptor 1291f77fdf7SHans de Goede than it advertises. The bLength field of each (sub) descriptor 1301f77fdf7SHans de Goede can be trusted, and can be used to seek forward one (sub) 1311f77fdf7SHans de Goede descriptor at a time until the next config descriptor is found. 1321f77fdf7SHans de Goede All descriptors read from this file are in bus-endian format 1332eb86032SHans de GoedeUsers: 1342eb86032SHans de Goede libusb 135db187a5bSHans de Goede 136db187a5bSHans de GoedeWhat: /sys/bus/usb/devices/.../speed 137db187a5bSHans de GoedeKernelVersion: since at least 2.6.18 138db187a5bSHans de GoedeDescription: 139db187a5bSHans de Goede Speed the device is connected with to the usb-host in 140db187a5bSHans de Goede Mbit / second. IE one of 1.5 / 12 / 480 / 5000. 1412eb86032SHans de GoedeUsers: 1422eb86032SHans de Goede libusb 143