ARM: tegra: nexus7: Enable USB OTG mode
authorDmitry Osipenko <digetx@gmail.com>
Sun, 12 Sep 2021 18:17:17 +0000 (21:17 +0300)
committerThierry Reding <treding@nvidia.com>
Mon, 4 Oct 2021 21:11:58 +0000 (23:11 +0200)
Nexus 7 has OTG-cable microUSB port, enable OTG mode. USB peripheral
devices now can be connected to Nexus 7 using OTG adapter, switching
USB port into host mode.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi

index 4a5840d..07d4ea1 100644 (file)
                        interrupts = <TEGRA_GPIO(V, 1) IRQ_TYPE_EDGE_BOTH>;
 
                        summit,enable-charge-control = <SMB3XX_CHG_ENABLE_PIN_ACTIVE_LOW>;
+                       summit,inok-polarity = <SMB3XX_SYSOK_INOK_ACTIVE_LOW>;
                        summit,enable-usb-charging;
 
                        monitored-battery = <&battery_cell>;
+
+                       usb_vbus: usb-vbus {
+                               regulator-name = "usb_vbus";
+                               regulator-min-microvolt = <5000000>;
+                               regulator-max-microvolt = <5000000>;
+                               regulator-min-microamp = <750000>;
+                               regulator-max-microamp = <750000>;
+
+                               /*
+                                * SMB347 INOK input pin is connected to PMIC's
+                                * ACOK output, which is fixed to ACTIVE_LOW as
+                                * long as battery voltage is in a good range.
+                                *
+                                * Active INOK disables SMB347 output, so polarity
+                                * needs to be toggled when we want to get the
+                                * output.
+                                */
+                               summit,needs-inok-toggle;
+                       };
                };
        };
 
        usb@7d000000 {
                compatible = "nvidia,tegra30-udc";
                status = "okay";
-               dr_mode = "peripheral";
+               dr_mode = "otg";
+               vbus-supply = <&usb_vbus>;
        };
 
        usb-phy@7d000000 {
                status = "okay";
-               dr_mode = "peripheral";
+               dr_mode = "otg";
                nvidia,hssync-start-delay = <0>;
                nvidia,xcvr-lsfslew = <2>;
                nvidia,xcvr-lsrslew = <2>;