Hi igorpadykov,
Thank you, I have shared the idea with our hardware engineer.
Your comment----"it is necessary to add modifications in code for USB_OTG2_PWR", does it mean that i need to modify the linux source code at driver/usb/chipidea ?
On the other hand, I try to use GPIO control VBUS of USBOTG2 according to sect.39.2.10.2 VBUS Control attached Linux Manual.
Fisrtly, I fix dts and slect GPIO1_IO02 to control VBUS of USBOTG2.
Then I boot the board with new dtb, but i get such error when try to change GPIO output value by GPIO SYSFS.
GPIO1_IO02, the GPIO address should be 32 * (1 - 1) + 2 = 2
echo 2 > /sys/class/gpio/export
write error: Device or resource busy
I try the command "echo 0 > /sys/class/gpio/export" and it's OK.
Why the GPIO1_IO02 can't export? And is using GPIO to control VBUS effective?