I’m trying to toggle USB port power by toggling the enable inputs to the USB power switches (SODIMM_155, SODIMM_185) but have been unsuccessful using /sys/bus/usb in torizon 6.5.0. Solutions such as Linux control USB power-enable switch do not appear to apply to current BSPs. I have confirmed that the devicetrees are correct for the USB enable outputs and if I unbind the regulators the output will go low and turn off the port:
line 12: “SODIMM_155” “regulator-usb1-vbus” output active-high [used]
line 13: “SODIMM_157” unused input active-high
line 14: “SODIMM_185” “regulator-usb2-vbus” output active-high [used]
echo “regulator-usb1-vbus” | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind
echo “regulator-usb2-vbus” | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind
I’ve tried unbinding the driver and using autosuspend but have been unsuccessful:
echo “usb1” | sudo tee /sys/bus/usb/drivers/usb/unbind
echo “usb2” | sudo tee /sys/bus/usb/drivers/usb/unbind
echo “0” | sudo tee /sys/bus/usb/devices/1-0:1.0/usb1-port1/power/autosuspend_delay_ms
echo “auto” | sudo tee /sys/bus/usb/devices/1-0:1.0/usb1-port1/power/control
echo “0” | sudo tee /sys/bus/usb/devices/2-0:1.0/usb2-port1/power/autosuspend_delay_ms
echo “auto” | sudo tee /sys/bus/usb/devices/2-0:1.0/usb2-port1/power/control
It also appears that I can’t use uhubctl on the root hubs per USB Host Mode (Linux):
torizon@verdin-imx8mp-15242127:~/debug-scripts$ sudo uhubctl
No compatible devices detected!
torizon@verdin-imx8mp-15242127:~/debug-scripts$ sudo uhubctl -f
Current status for hub 4 [1d6b:0003 Linux 5.15.129-6.5.0-devel+git.d6880bf83a40 xhci-hcd xHCI Host Controller xhci-hcd.2.auto, USB 3.00, 1 ports, nops]
Port 1: 02a0 power 5gbps Rx.Detect
Current status for hub 3 [1d6b:0002 Linux 5.15.129-6.5.0-devel+git.d6880bf83a40 xhci-hcd xHCI Host Controller xhci-hcd.2.auto, USB 2.00, 1 ports, nops]
Port 1: 0100 power
Current status for hub 2 [1d6b:0003 Linux 5.15.129-6.5.0-devel+git.d6880bf83a40 xhci-hcd xHCI Host Controller xhci-hcd.1.auto, USB 3.00, 1 ports, nops]
Port 1: 02a0 power 5gbps Rx.Detect
Current status for hub 1 [1d6b:0002 Linux 5.15.129-6.5.0-devel+git.d6880bf83a40 xhci-hcd xHCI Host Controller xhci-hcd.1.auto, USB 2.00, 1 ports, nops]
Port 1: 0100 power
Can USB port power still be toggled using /sys/bus/usb?
I might make mistakes or occasionally get you wrong. Our support team will step in if needed.
I’d be glad to help! Could you let me know which hardware you’re using and which version of Torizon OS you’re running? For example, are you using a Verdin iMX8M Plus, Verdin AM62, or another SoM? And what’s the exact version of Torizon OS 6.5.0 (e.g., 6.5.0-build.XX)?
The USB power control approach varies significantly between different hardware platforms and OS versions, so I want to ensure I provide you with the correct guidance for your specific setup.
I don’t have specific documentation about USB port power control via /sys/bus/usb for your exact setup (Verdin iMX8M Plus on Mallow Board with Torizon OS 6.5.0-devel) in the available sources.
However, your approach of unbinding the regulators appears to be working correctly, as you’ve confirmed that unbinding the fixed voltage regulators does turn off the USB ports:
echo "regulator-usb1-vbus" | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind
echo "regulator-usb2-vbus" | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind
For more comprehensive information about USB power control methods and troubleshooting, I’d recommend checking these potentially relevant sources:
USB port power cannot be toggled using the standard /sys/bus/usb interfaces (autosuspend, power/control, driver unbind, etc.) on the Verdin iMX8M Plus with Torizon 6.8.0
The VBUS power switches on SODIMM_155 (USB1) and SODIMM_185 (USB2) are not controlled by the xHCI host controller or the USB subsystem.
They are managed exclusively by the fixed-voltage regulators (regulator-usb1-vbus / regulator-usb2-vbus) in the device tree, which directly drive the GPIO enable signals (active-high).
Unbinding the regulator driver is the only reliable way in the current BSP to drive the enable pins low and cut VBUS:
echo "regulator-usb1-vbus" | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind
echo "regulator-usb2-vbus" | sudo tee /sys/bus/platform/drivers/reg-fixed-voltage/unbind