18c2ecf20Sopenharmony_ciWhat: /sys/bus/pci/drivers/ehci_hcd/.../companion 28c2ecf20Sopenharmony_ci /sys/bus/usb/devices/usbN/../companion 38c2ecf20Sopenharmony_ciDate: January 2007 48c2ecf20Sopenharmony_ciKernelVersion: 2.6.21 58c2ecf20Sopenharmony_ciContact: Alan Stern <stern@rowland.harvard.edu> 68c2ecf20Sopenharmony_ciDescription: 78c2ecf20Sopenharmony_ci PCI-based EHCI USB controllers (i.e., high-speed USB-2.0 88c2ecf20Sopenharmony_ci controllers) are often implemented along with a set of 98c2ecf20Sopenharmony_ci "companion" full/low-speed USB-1.1 controllers. When a 108c2ecf20Sopenharmony_ci high-speed device is plugged in, the connection is routed 118c2ecf20Sopenharmony_ci to the EHCI controller; when a full- or low-speed device 128c2ecf20Sopenharmony_ci is plugged in, the connection is routed to the companion 138c2ecf20Sopenharmony_ci controller. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci Sometimes you want to force a high-speed device to connect 168c2ecf20Sopenharmony_ci at full speed, which can be accomplished by forcing the 178c2ecf20Sopenharmony_ci connection to be routed to the companion controller. 188c2ecf20Sopenharmony_ci That's what this file does. Writing a port number to the 198c2ecf20Sopenharmony_ci file causes connections on that port to be routed to the 208c2ecf20Sopenharmony_ci companion controller, and writing the negative of a port 218c2ecf20Sopenharmony_ci number returns the port to normal operation. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci For example: To force the high-speed device attached to 248c2ecf20Sopenharmony_ci port 4 on bus 2 to run at full speed:: 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci echo 4 >/sys/bus/usb/devices/usb2/../companion 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci To return the port to high-speed operation:: 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci echo -4 >/sys/bus/usb/devices/usb2/../companion 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci Reading the file gives the list of ports currently forced 338c2ecf20Sopenharmony_ci to the companion controller. 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci Note: Some EHCI controllers do not have companions; they 368c2ecf20Sopenharmony_ci may contain an internal "transaction translator" or they 378c2ecf20Sopenharmony_ci may be attached directly to a "rate-matching hub". This 388c2ecf20Sopenharmony_ci mechanism will not work with such controllers. Also, it 398c2ecf20Sopenharmony_ci cannot be used to force a port on a high-speed hub to 408c2ecf20Sopenharmony_ci connect at full speed. 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci Note: When this file was first added, it appeared in a 438c2ecf20Sopenharmony_ci different sysfs directory. The location given above is 448c2ecf20Sopenharmony_ci correct for 2.6.35 (and probably several earlier kernel 458c2ecf20Sopenharmony_ci versions as well). 468c2ecf20Sopenharmony_ci 47