Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / phy / meson-g12a-usb2.c
index ad1a77f..447ce72 100644 (file)
@@ -8,12 +8,15 @@
  */
 
 #include <common.h>
+#include <log.h>
+#include <malloc.h>
 #include <asm/io.h>
 #include <bitfield.h>
 #include <dm.h>
 #include <errno.h>
 #include <generic-phy.h>
 #include <regmap.h>
+#include <linux/delay.h>
 #include <power/regulator.h>
 #include <reset.h>
 #include <clk.h>
@@ -63,10 +66,10 @@ struct phy_meson_g12a_usb2_priv {
 
 static int phy_meson_g12a_usb2_power_on(struct phy *phy)
 {
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
        struct udevice *dev = phy->dev;
        struct phy_meson_g12a_usb2_priv *priv = dev_get_priv(dev);
 
-#if CONFIG_IS_ENABLED(DM_REGULATOR)
        if (priv->phy_supply) {
                int ret = regulator_set_enable(priv->phy_supply, true);
                if (ret)
@@ -79,10 +82,10 @@ static int phy_meson_g12a_usb2_power_on(struct phy *phy)
 
 static int phy_meson_g12a_usb2_power_off(struct phy *phy)
 {
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
        struct udevice *dev = phy->dev;
        struct phy_meson_g12a_usb2_priv *priv = dev_get_priv(dev);
 
-#if CONFIG_IS_ENABLED(DM_REGULATOR)
        if (priv->phy_supply) {
                int ret = regulator_set_enable(priv->phy_supply, false);
                if (ret) {