Disable USB VBUS power supply

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable USB VBUS power supply

938 Views
enginlee
Contributor II

Hi,

I am trying to power off USB port on my i.MX6ULL with 4.14.78 BSP and there is an instruction on the reference manual:

4.9.8 How to Close the USB Child Device Power
The following code string outlines how to close the USB child device power:
echo auto > /sys/bus/usb/devices/1-1/power/control
echo auto > /sys/bus/usb/devices/1-1.1/power/control (If there is a hub at USB device)

But it seems not working like that:

echo auto > /sys/bus/usb/devices/1-1/power/control   // -> nothing happened

echo auto > /sys/bus/usb/devices/usb1/power/control   // -> device detached, but VBUS 5V is still ON

Even if I enter deep sleep mode (echo mem > /sys/power/state), VBUS 5V  is still ON.

Is there any setting or configuration to change this behavior? I don't want to get USB devices to be charged from USB port after entering deep sleep mode.

Thanks,

-Engin

0 Kudos
3 Replies

441 Views
b36401
NXP TechSupport
NXP TechSupport

Actually USB is powered even in deep sleep mode.
Please try to turn off USB power with the command like this:

# echo suspend > /sys/bus/usb/devices/usb1/power/control

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

441 Views
enginlee
Contributor II

But I got an error...

# echo suspend > /sys/bus/usb/devices/usb1/power/control
sh: write error: Invalid argument
# echo suspend > /sys/bus/usb/devices/usb2/power/control
sh: write error: Invalid argument

0 Kudos

441 Views
enginlee
Contributor II

Finally, I found a way to control VBUS 5V power:

Build ChipIdea USB driver as kernel modules, and then you can enable/disable VBUS 5V power by installing/removing ko file.

0 Kudos