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: 6cc583db3SPaul Bolle USB device directories can contain a file named power/persist. 7cc583db3SPaul Bolle The file holds a boolean value (0 or 1) indicating whether or 8cc583db3SPaul Bolle not the "USB-Persist" facility is enabled for the device. For 9cc583db3SPaul Bolle hubs this facility is always enabled and their device 10cc583db3SPaul Bolle directories will not contain this file. 11cc583db3SPaul Bolle 12e1c3e6e1SMauro Carvalho Chehab For more information, see Documentation/driver-api/usb/persist.rst. 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: 35ceb6c9c8SRafael J. Wysocki If CONFIG_PM is enabled, then this file is present. When read, 36ceb6c9c8SRafael J. Wysocki it returns the total time (in msec) that the USB device has been 37ceb6c9c8SRafael J. Wysocki connected to the machine. This file is read-only. 381f77fdf7SHans de GoedeUsers: 39aaf3d29fSRafael J. Wysocki PowerTOP <powertop@lists.01.org> 40aaf3d29fSRafael J. Wysocki https://01.org/powertop/ 411f77fdf7SHans de Goede 421f77fdf7SHans de GoedeWhat: /sys/bus/usb/device/.../power/active_duration 431f77fdf7SHans de GoedeDate: January 2008 441f77fdf7SHans de GoedeKernelVersion: 2.6.25 451f77fdf7SHans de GoedeContact: Sarah Sharp <sarah.a.sharp@intel.com> 461f77fdf7SHans de GoedeDescription: 47ceb6c9c8SRafael J. Wysocki If CONFIG_PM is enabled, then this file is present. When read, 48ceb6c9c8SRafael J. Wysocki it returns the total time (in msec) that the USB device has been 49ceb6c9c8SRafael J. Wysocki active, i.e. not in a suspended state. This file is read-only. 501f77fdf7SHans de Goede 511f77fdf7SHans de Goede Tools can use this file and the connected_duration file to 521f77fdf7SHans de Goede compute the percentage of time that a device has been active. 531f77fdf7SHans de Goede For example, 541f77fdf7SHans de Goede echo $((100 * `cat active_duration` / `cat connected_duration`)) 551f77fdf7SHans de Goede will give an integer percentage. Note that this does not 561f77fdf7SHans de Goede account for counter wrap. 571f77fdf7SHans de GoedeUsers: 58aaf3d29fSRafael J. Wysocki PowerTOP <powertop@lists.01.org> 59aaf3d29fSRafael J. Wysocki https://01.org/powertop/ 601f77fdf7SHans de Goede 611f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend 621f77fdf7SHans de GoedeDate: January 2008 631f77fdf7SHans de GoedeKernelVersion: 2.6.27 641f77fdf7SHans de GoedeContact: Sarah Sharp <sarah.a.sharp@intel.com> 651f77fdf7SHans de GoedeDescription: 661f77fdf7SHans de Goede When read, this file returns 1 if the interface driver 671f77fdf7SHans de Goede for this interface supports autosuspend. It also 681f77fdf7SHans de Goede returns 1 if no driver has claimed this interface, as an 691f77fdf7SHans de Goede unclaimed interface will not stop the device from being 701f77fdf7SHans de Goede autosuspended if all other interface drivers are idle. 711f77fdf7SHans de Goede The file returns 0 if autosuspend support has not been 721f77fdf7SHans de Goede added to the driver. 731f77fdf7SHans de GoedeUsers: 741f77fdf7SHans de Goede USB PM tool 751f77fdf7SHans de Goede git://git.moblin.org/users/sarah/usb-pm-tool/ 761f77fdf7SHans de Goede 771f77fdf7SHans de GoedeWhat: /sys/bus/usb/device/.../avoid_reset_quirk 781f77fdf7SHans de GoedeDate: December 2009 791f77fdf7SHans de GoedeContact: Oliver Neukum <oliver@neukum.org> 801f77fdf7SHans de GoedeDescription: 811f77fdf7SHans de Goede Writing 1 to this file tells the kernel that this 821f77fdf7SHans de Goede device will morph into another mode when it is reset. 831f77fdf7SHans de Goede Drivers will not use reset for error handling for 841f77fdf7SHans de Goede such devices. 851f77fdf7SHans de GoedeUsers: 861f77fdf7SHans de Goede usb_modeswitch 871f77fdf7SHans de Goede 881f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../devnum 891f77fdf7SHans de GoedeKernelVersion: since at least 2.6.18 901f77fdf7SHans de GoedeDescription: 911f77fdf7SHans de Goede Device address on the USB bus. 922eb86032SHans de GoedeUsers: 932eb86032SHans de Goede libusb 941f77fdf7SHans de Goede 951f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../bConfigurationValue 961f77fdf7SHans de GoedeKernelVersion: since at least 2.6.18 971f77fdf7SHans de GoedeDescription: 981f77fdf7SHans de Goede bConfigurationValue of the *active* configuration for the 991f77fdf7SHans de Goede device. Writing 0 or -1 to bConfigurationValue will reset the 1001f77fdf7SHans de Goede active configuration (unconfigure the device). Writing 1011f77fdf7SHans de Goede another value will change the active configuration. 1021f77fdf7SHans de Goede 1031f77fdf7SHans de Goede Note that some devices, in violation of the USB spec, have a 1041f77fdf7SHans de Goede configuration with a value equal to 0. Writing 0 to 1051f77fdf7SHans de Goede bConfigurationValue for these devices will install that 1061f77fdf7SHans de Goede configuration, rather then unconfigure the device. 1071f77fdf7SHans de Goede 1081f77fdf7SHans de Goede Writing -1 will always unconfigure the device. 1092eb86032SHans de GoedeUsers: 1102eb86032SHans de Goede libusb 1111f77fdf7SHans de Goede 1121f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../busnum 1131f77fdf7SHans de GoedeKernelVersion: 2.6.22 1141f77fdf7SHans de GoedeDescription: 1151f77fdf7SHans de Goede Bus-number of the USB-bus the device is connected to. 1162eb86032SHans de GoedeUsers: 1172eb86032SHans de Goede libusb 1181f77fdf7SHans de Goede 1191f77fdf7SHans de GoedeWhat: /sys/bus/usb/devices/.../descriptors 1201f77fdf7SHans de GoedeKernelVersion: 2.6.26 1211f77fdf7SHans de GoedeDescription: 1221f77fdf7SHans de Goede Binary file containing cached descriptors of the device. The 1231f77fdf7SHans de Goede binary data consists of the device descriptor followed by the 1241f77fdf7SHans de Goede descriptors for each configuration of the device. 1251f77fdf7SHans de Goede Note that the wTotalLength of the config descriptors can not 1261f77fdf7SHans de Goede be trusted, as the device may have a smaller config descriptor 1271f77fdf7SHans de Goede than it advertises. The bLength field of each (sub) descriptor 1281f77fdf7SHans de Goede can be trusted, and can be used to seek forward one (sub) 1291f77fdf7SHans de Goede descriptor at a time until the next config descriptor is found. 1301f77fdf7SHans de Goede All descriptors read from this file are in bus-endian format 1312eb86032SHans de GoedeUsers: 1322eb86032SHans de Goede libusb 133db187a5bSHans de Goede 134db187a5bSHans de GoedeWhat: /sys/bus/usb/devices/.../speed 135db187a5bSHans de GoedeKernelVersion: since at least 2.6.18 136db187a5bSHans de GoedeDescription: 137db187a5bSHans de Goede Speed the device is connected with to the usb-host in 138db187a5bSHans de Goede Mbit / second. IE one of 1.5 / 12 / 480 / 5000. 1392eb86032SHans de GoedeUsers: 1402eb86032SHans de Goede libusb 141