xref: /OK3568_Linux_fs/kernel/Documentation/ABI/stable/sysfs-bus-usb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../power/persist
2*4882a593SmuzhiyunDate:		May 2007
3*4882a593SmuzhiyunKernelVersion:	2.6.23
4*4882a593SmuzhiyunContact:	Alan Stern <stern@rowland.harvard.edu>
5*4882a593SmuzhiyunDescription:
6*4882a593Smuzhiyun		USB device directories can contain a file named power/persist.
7*4882a593Smuzhiyun		The file holds a boolean value (0 or 1) indicating whether or
8*4882a593Smuzhiyun		not the "USB-Persist" facility is enabled for the device.  For
9*4882a593Smuzhiyun		hubs this facility is always enabled and their device
10*4882a593Smuzhiyun		directories will not contain this file.
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun		For more information, see Documentation/driver-api/usb/persist.rst.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../power/autosuspend
15*4882a593SmuzhiyunDate:		March 2007
16*4882a593SmuzhiyunKernelVersion:	2.6.21
17*4882a593SmuzhiyunContact:	Alan Stern <stern@rowland.harvard.edu>
18*4882a593SmuzhiyunDescription:
19*4882a593Smuzhiyun		Each USB device directory will contain a file named
20*4882a593Smuzhiyun		power/autosuspend.  This file holds the time (in seconds)
21*4882a593Smuzhiyun		the device must be idle before it will be autosuspended.
22*4882a593Smuzhiyun		0 means the device will be autosuspended as soon as
23*4882a593Smuzhiyun		possible.  Negative values will prevent the device from
24*4882a593Smuzhiyun		being autosuspended at all, and writing a negative value
25*4882a593Smuzhiyun		will resume the device if it is already suspended.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun		The autosuspend delay for newly-created devices is set to
28*4882a593Smuzhiyun		the value of the usbcore.autosuspend module parameter.
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunWhat:		/sys/bus/usb/device/.../power/connected_duration
31*4882a593SmuzhiyunDate:		January 2008
32*4882a593SmuzhiyunKernelVersion:	2.6.25
33*4882a593SmuzhiyunContact:	Sarah Sharp <sarah.a.sharp@intel.com>
34*4882a593SmuzhiyunDescription:
35*4882a593Smuzhiyun		If CONFIG_PM is enabled, then this file is present.  When read,
36*4882a593Smuzhiyun		it returns the total time (in msec) that the USB device has been
37*4882a593Smuzhiyun		connected to the machine.  This file is read-only.
38*4882a593SmuzhiyunUsers:
39*4882a593Smuzhiyun		PowerTOP <powertop@lists.01.org>
40*4882a593Smuzhiyun		https://01.org/powertop/
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunWhat:		/sys/bus/usb/device/.../power/active_duration
43*4882a593SmuzhiyunDate:		January 2008
44*4882a593SmuzhiyunKernelVersion:	2.6.25
45*4882a593SmuzhiyunContact:	Sarah Sharp <sarah.a.sharp@intel.com>
46*4882a593SmuzhiyunDescription:
47*4882a593Smuzhiyun		If CONFIG_PM is enabled, then this file is present.  When read,
48*4882a593Smuzhiyun		it returns the total time (in msec) that the USB device has been
49*4882a593Smuzhiyun		active, i.e. not in a suspended state.  This file is read-only.
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun		Tools can use this file and the connected_duration file to
52*4882a593Smuzhiyun		compute the percentage of time that a device has been active.
53*4882a593Smuzhiyun		For example::
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun		  echo $((100 * `cat active_duration` / `cat connected_duration`))
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun		will give an integer percentage.  Note that this does not
58*4882a593Smuzhiyun		account for counter wrap.
59*4882a593SmuzhiyunUsers:
60*4882a593Smuzhiyun		PowerTOP <powertop@lists.01.org>
61*4882a593Smuzhiyun		https://01.org/powertop/
62*4882a593Smuzhiyun
63*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/<busnum>-<port[.port]>...:<config num>-<interface num>/supports_autosuspend
64*4882a593SmuzhiyunDate:		January 2008
65*4882a593SmuzhiyunKernelVersion:	2.6.27
66*4882a593SmuzhiyunContact:	Sarah Sharp <sarah.a.sharp@intel.com>
67*4882a593SmuzhiyunDescription:
68*4882a593Smuzhiyun		When read, this file returns 1 if the interface driver
69*4882a593Smuzhiyun		for this interface supports autosuspend.  It also
70*4882a593Smuzhiyun		returns 1 if no driver has claimed this interface, as an
71*4882a593Smuzhiyun		unclaimed interface will not stop the device from being
72*4882a593Smuzhiyun		autosuspended if all other interface drivers are idle.
73*4882a593Smuzhiyun		The file returns 0 if autosuspend support has not been
74*4882a593Smuzhiyun		added to the driver.
75*4882a593SmuzhiyunUsers:
76*4882a593Smuzhiyun		USB PM tool
77*4882a593Smuzhiyun		git://git.moblin.org/users/sarah/usb-pm-tool/
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunWhat:		/sys/bus/usb/device/.../avoid_reset_quirk
80*4882a593SmuzhiyunDate:		December 2009
81*4882a593SmuzhiyunContact:	Oliver Neukum <oliver@neukum.org>
82*4882a593SmuzhiyunDescription:
83*4882a593Smuzhiyun		Writing 1 to this file tells the kernel that this
84*4882a593Smuzhiyun		device will morph into another mode when it is reset.
85*4882a593Smuzhiyun		Drivers will not use reset for error handling for
86*4882a593Smuzhiyun		such devices.
87*4882a593SmuzhiyunUsers:
88*4882a593Smuzhiyun		usb_modeswitch
89*4882a593Smuzhiyun
90*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../devnum
91*4882a593SmuzhiyunKernelVersion:	since at least 2.6.18
92*4882a593SmuzhiyunDescription:
93*4882a593Smuzhiyun		Device address on the USB bus.
94*4882a593SmuzhiyunUsers:
95*4882a593Smuzhiyun		libusb
96*4882a593Smuzhiyun
97*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../bConfigurationValue
98*4882a593SmuzhiyunKernelVersion:	since at least 2.6.18
99*4882a593SmuzhiyunDescription:
100*4882a593Smuzhiyun		bConfigurationValue of the *active* configuration for the
101*4882a593Smuzhiyun		device. Writing 0 or -1 to bConfigurationValue will reset the
102*4882a593Smuzhiyun		active configuration (unconfigure the device). Writing
103*4882a593Smuzhiyun		another value will change the active configuration.
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun		Note that some devices, in violation of the USB spec, have a
106*4882a593Smuzhiyun		configuration with a value equal to 0. Writing 0 to
107*4882a593Smuzhiyun		bConfigurationValue for these devices will install that
108*4882a593Smuzhiyun		configuration, rather then unconfigure the device.
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun		Writing -1 will always unconfigure the device.
111*4882a593SmuzhiyunUsers:
112*4882a593Smuzhiyun		libusb
113*4882a593Smuzhiyun
114*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../busnum
115*4882a593SmuzhiyunKernelVersion:	2.6.22
116*4882a593SmuzhiyunDescription:
117*4882a593Smuzhiyun		Bus-number of the USB-bus the device is connected to.
118*4882a593SmuzhiyunUsers:
119*4882a593Smuzhiyun		libusb
120*4882a593Smuzhiyun
121*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../descriptors
122*4882a593SmuzhiyunKernelVersion:	2.6.26
123*4882a593SmuzhiyunDescription:
124*4882a593Smuzhiyun		Binary file containing cached descriptors of the device. The
125*4882a593Smuzhiyun		binary data consists of the device descriptor followed by the
126*4882a593Smuzhiyun		descriptors for each configuration of the device.
127*4882a593Smuzhiyun		Note that the wTotalLength of the config descriptors can not
128*4882a593Smuzhiyun		be trusted, as the device may have a smaller config descriptor
129*4882a593Smuzhiyun		than it advertises. The bLength field of each (sub) descriptor
130*4882a593Smuzhiyun		can be trusted, and can be used to seek forward one (sub)
131*4882a593Smuzhiyun		descriptor at a time until the next config descriptor is found.
132*4882a593Smuzhiyun		All descriptors read from this file are in bus-endian format
133*4882a593SmuzhiyunUsers:
134*4882a593Smuzhiyun		libusb
135*4882a593Smuzhiyun
136*4882a593SmuzhiyunWhat:		/sys/bus/usb/devices/.../speed
137*4882a593SmuzhiyunKernelVersion:	since at least 2.6.18
138*4882a593SmuzhiyunDescription:
139*4882a593Smuzhiyun		Speed the device is connected with to the usb-host in
140*4882a593Smuzhiyun		Mbit / second. IE one of 1.5 / 12 / 480 / 5000.
141*4882a593SmuzhiyunUsers:
142*4882a593Smuzhiyun		libusb
143