Hello everyone,
I want to power off the USB port. Our hardware around the efusA9X-board allows to enable / disable USB vbus via pin 212 of the efusA9X-board (low active). Pin 212 is USBH_A_PWR , GPIO1_IO12 of the device USB_OTG2.
What I tried is:
Power off:
!> echo 'usb1' > /sys/bus/usb/drivers/usb/unbind
Power on:
!> echo 'usb1' > /sys/bus/usb/drivers/usb/bind
At first glance, this seems to work. However, it only puts the connected USB device into suspend mode. It does not disable the VBUS power.
Then I tried to control pin 212 directly (pin 212 is gpio 12):
Export pin to have it in /sys/class/gpio:
!> echo 12 > /sys/class/gpio/export
Set pin to output:
!> echo out > /sys/class/gpio/gpio12/direction
Set pin high (should disable power).
!> echo 1 > /sys/class/gpio/gpio12/value
I tried also low:
!> echo 0 > /sys/class/gpio/gpio12/value
But nothing happens.
The USB relevant part of the device-tree is the following:
- /* USB - USB OTG1 has over-current detection on OC pin */
- #define CONFIG_EFUSA9X_USB_OTG1
- #define CONFIG_EFUSA9X_USB_OTG1_OC
- #define CONFIG_EFUSA9X_USB_HOST
- …
- #ifdef CONFIG_EFUSA9X_USB_HOST
- &usbotg2 {
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_usbotg2>;
- //### vbus-supply = <®_usb_otg2_vbus>;
- dr_mode = "host";
- power-active-high;
- disable-over-current;
- status = "okay";
- };
- #endif
- …
- #ifdef CONFIG_EFUSA9X_USB_HOST
- pinctrl_usbotg2: usbotg2grp {
- fsl,pins = <
- /* USB_OTG2_PWR, active high */
- //### MX6SX_PAD_GPIO1_IO12__GPIO1_IO_12 0x03030
- MX6SX_PAD_GPIO1_IO12__USB_OTG2_PWR 0x03030
- >;
- };
- #endif
- …
In principle, USB devices connected to the port work. But powering off does not work.
The system is:
efusA9X, Kernel 5.15.148, Yocto fsimx6-Y2024.04, with MACH=fsimx6sx and Silex driver.
Do you have any idea what I'm doing wrong? it would be very nice if someone could help to solve this problem.
Best regards, Habi