Linux how to control USB power supply --- Measured effective.

Excerpt: https: //cloud.tencent.com/developer/ask/28501

method one:

You can configure the FE Terminus 1.1 USB hub chip:
 the purple color Found Effective:
 1 . Power off all USB ports in the hub, the hub can be released using the command from the kernel: 
echo " 1-4.4.4 " > / SYS / Bus / USB / Drivers / USB / the unbind 
turn the power
- you can use rebind echo " 1-4.4.4 " > / SYS / Bus / USB / Drivers / USB / the bind
2 each port of the switching power supply is more troublesome separately:. I can use to control each port hubpower - but it has a drawback: hubpower usbdevfs to first disconnect, causing all USB device is disconnected from the system, at least on Ubuntu is such that: usb_ioctl.ioctl_code = USBDEVFS_DISCONNECT; RC = the ioctl ( fd, USBDEVFS_IOCTL, & usb_ioctl);

 

Method Two:

note. The answer is the old kernel-related information (up to 2 6.32 ). For information about the new kernel, see tlwhitec. 

External disable the Wake # -UP; do  the this only Once 
echo Disabled > / SYS / Bus / the USB / Devices / USB1 / Power / Wakeup 

echo ON > / SYS / Bus / the USB / Devices / USB1 / Power / Level # Turn ON 
echo Suspend > / SYS / Bus / the USB / Devices / usb1 / Power / Level # Turn OFF 
(you may need to change usb1 to usb n)

 

Guess you like

Origin www.cnblogs.com/LiuYanYGZ/p/12346563.html