USB Power Control

How can i control the USB_VBUS_EN0 Pin to switch the USB0 VBUS Power on and off?

Hi, please refer to this topic:

Sorry, this doesn’t realy help me. How can i switch USB_VBUS_EN0 from command line?

I have this:

root@tx1:/# sudo cat /sys/kernel/debug/gpio
GPIOs 0-255, platform/6000d000.gpio, tegra-gpio:
 gpio-2   (pcie_wake           ) in  hi
 gpio-28  (usb-vbus3           ) out lo
 gpio-56  (wlan_pwr            ) out hi
 gpio-57  (rtl-5v0             ) out hi
 gpio-59  (bt_ext_wake         ) out hi
 gpio-60  (reset_gpio          ) out lo
 gpio-61  (bt_host_wake        ) in  lo
 gpio-67  (vdd-disp-3v0        ) out lo
 gpio-169 (lcd-bl-en           ) out lo
 gpio-188 (temp_alert          ) in  hi
 gpio-189 (Power               ) in  hi
 gpio-190 (Volume Up           ) in  hi
 gpio-192 (Volume Down         ) in  hi
 gpio-200 (1.extcon            ) in  lo
 gpio-201 (sdhci_cd            ) in  hi
 gpio-203 (en-vdd-sd           ) out lo
 gpio-204 (sdhci_wp            ) in  hi
 gpio-225 (hdmi2.0_hpd         ) in  lo
 gpio-228 (usb-vbus1           ) in  hi
 gpio-229 (en-usb-vbus2        ) out hi

GPIOs 1016-1023, platform/max77620-gpio.0, max77620-gpio, can sleep:
 gpio-1016 (1.extcon            ) in  lo
 gpio-1017 (vdd-sys-boost       ) out lo
 gpio-1019 (vdd-3v3             ) out lo
 gpio-1022 (regulator-pwm       ) out lo
 gpio-1023 (max77620-gpio7      ) out lo

This one does not work:

cd /sys/class/gpio
echo 228 > export
bash: echo: write error: Device or resource busy

I have solved my problem by decompiling, editing and compiling the dtb(Device Tree Binary). You can find a tutorial here

Just delete the following line with “usb-vbus1” in the dts:

regulator@14 {
			compatible = "regulator-fixed-sync";
			reg = <0xe>;
			regulator-name = "usb-vbus1";
			regulator-min-microvolt = <0x4c4b40>;
			regulator-max-microvolt = <0x4c4b40>;
			gpio = <0x6b 0xe4 0x0>;
			vin-supply = <0x5b>;
			linux,phandle = <0xa4>;
			phandle = <0xa4>;

Now compile your dts to a new dtb and boot with this new Device Tree.
This allows you to switch USB_VBUS_EN0 with this commands:

sudo su
cd /sys/class/gpio
echo 228 > export
cd gpio228
echo out > direction && echo 1 > value