Unable to set usb-vbus1 to high (gpio 228) on Jetson TX1

Using Tegra210_Linux_R24.1.0, has issues in setting the usb-vbus1 to high by default.

ubuntu@tegra-ubuntu:~$ sudo cat /sys/kernel/debug/gpio
[sudo] password for ubuntu:
GPIOs 0-255, platform/6000d000.gpio, tegra-gpio:
gpio-0 (cam_pwdn_gpio ) in lo
gpio-2 (pcie_wake ) in hi
gpio-28 (usb-vbus3 ) out lo
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-65 (sysfs ) out lo
gpio-67 (vdd-disp-3v0 ) out lo
gpio-148 (sysfs ) out lo
gpio-149 (sysfs ) out lo
gpio-169 (lcd-bl-en ) out lo
gpio-186 (sysfs ) out lo
gpio-187 (sysfs ) 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 lo
gpio-228 (usb-vbus1 ) out lo
gpio-229 (en-usb-vbus2 ) out hi

GPIOs 1016-1023, platform/max77620-gpio.0, max77620-gpio, can sleep:
gpio-1016 (1.extcon ) in hi
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

I tried using the pinmux file but could not.

From uboot I could set this pin high using the gpio command (gpio set 228) but once kernel boots it is getting to low.

If I try to export I get device busy error
root@tegra-ubuntu:/sys/class/gpio# echo 228 > /sys/class/gpio/export
bash: echo: write error: Device or resource busy

any suggestion on how to control gpio 228…

rkumar

hello rkiskum,

there’s GPIO mappings during kernel init stage.
please refer to this devtalk topic, https://devtalk.nvidia.com/default/topic/1029909/jetson-tx2/how-to-switch-the-led-or-relay-using-jetson-tx2-gpio-pins-/post/5239254/#5239254
thanks

I could not resolve the issue from the links. I see below declaration in dtsi file, should I create a similar declaration for usb_vbus1 (gpio228). where can I find the regulator information for gpio228.

The below is the declaration for gpio229.

            en_usb_vbus2: regulator@208 {
                    compatible = "regulator-fixed-sync";
                    reg = <208>;
                    regulator-name = "en-usb-vbus2";
                    regulator-min-microvol = <5000000>;
                    regulator-max-microvol = <5000000>;
                    gpio = <&gpio TEGRA_GPIO(CC, 5) 0>;
                    enable-active-high;
            };

Thanks
rkumar

hello rkiskum,

you could disassembler the dtb file into txt file to check the usb-vbus1 declaration.
for example,

dtc -I dtb -O dts -o temp.txt tegra210-jetson-cv-base-p2597-2180-a00.dtb