common: Drop linux/delay.h from common header
[oweals/u-boot.git] / drivers / usb / dwc3 / dwc3-meson-g12a.c
index d4453f8784cbfdaa38196d57b6dc0bce7674c4ef..6567502cdd1fd4e19265127bbe965fa5d5d4bd71 100644 (file)
@@ -7,12 +7,14 @@
  */
 
 #include <common.h>
+#include <log.h>
 #include <asm-generic/io.h>
 #include <dm.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
 #include <dwc3-uboot.h>
 #include <generic-phy.h>
+#include <linux/delay.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 #include <malloc.h>
@@ -408,6 +410,15 @@ static int dwc3_meson_g12a_probe(struct udevice *dev)
                        goto err_phy_init;
        }
 
+       for (i = 0; i < PHY_COUNT; ++i) {
+               if (!priv->phys[i].dev)
+                       continue;
+
+               ret = generic_phy_power_on(&priv->phys[i]);
+               if (ret)
+                       goto err_phy_init;
+       }
+
        return 0;
 
 err_phy_init:
@@ -430,6 +441,13 @@ static int dwc3_meson_g12a_remove(struct udevice *dev)
 
        clk_release_all(&priv->clk, 1);
 
+       for (i = 0; i < PHY_COUNT; ++i) {
+               if (!priv->phys[i].dev)
+                       continue;
+
+                generic_phy_power_off(&priv->phys[i]);
+       }
+
        for (i = 0 ; i < PHY_COUNT ; ++i) {
                if (!priv->phys[i].dev)
                        continue;