]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/dwc3/ti_usb_phy.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / drivers / usb / dwc3 / ti_usb_phy.c
index e6048ebf026ce96dba7e5dd9f29cda15ae0e057a..925f56c97c816efac37a2c2c6be1017d803c057b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /**
  * ti_usb_phy.c - USB3 and USB3 PHY programming for dwc3
  *
@@ -13,8 +14,6 @@
  *
  * "commit eb82a3 : phy: omap-usb2: Balance pm_runtime_enable() on probe failure
  * and remove" for phy-omap-usb2.c
- *
- * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
@@ -193,8 +192,11 @@ void ti_usb2_phy_power(struct ti_usb_phy *phy, int on)
        val = readl(phy->usb2_phy_power);
 
        if (on) {
-#ifdef CONFIG_DRA7XX
-               val &= ~OMAP_CTRL_DEV_PHY_PD;
+#if defined(CONFIG_DRA7XX)
+               if (phy->index == 1)
+                       val &= ~OMAP_CTRL_USB2_PHY_PD;
+               else
+                       val &= ~OMAP_CTRL_DEV_PHY_PD;
 #elif defined(CONFIG_AM43XX)
                val &= ~(AM437X_CTRL_USB2_PHY_PD |
                         AM437X_CTRL_USB2_OTG_PD);
@@ -202,8 +204,12 @@ void ti_usb2_phy_power(struct ti_usb_phy *phy, int on)
                        AM437X_CTRL_USB2_OTGSESSEND_EN);
 #endif
        } else {
-#ifdef CONFIG_DRA7XX
-               val |= OMAP_CTRL_DEV_PHY_PD;
+#if defined(CONFIG_DRA7XX)
+               if (phy->index == 1)
+                       val |= OMAP_CTRL_USB2_PHY_PD;
+               else
+                       val |= OMAP_CTRL_DEV_PHY_PD;
+
 #elif defined(CONFIG_AM43XX)
                val &= ~(AM437X_CTRL_USB2_OTGVDET_EN |
                         AM437X_CTRL_USB2_OTGSESSEND_EN);