Disable USB VBUS power supply

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Disable USB VBUS power supply

3,822 次查看
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

标记 (3)
0 项奖励
回复
3 回复数

3,325 次查看
b36401
NXP Employee
NXP Employee

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 项奖励
回复

3,325 次查看
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 项奖励
回复

3,325 次查看
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 项奖励
回复