ARM: am33xx: fix typo in spl.h
[oweals/u-boot.git] / arch / arm / mach-sunxi / usb_phy.c
index b258ce4443cb5eaa98fe0d5bbd385795cee60497..9bf0b5633d4a5b1462603d1033146248d9c76f12 100644 (file)
@@ -85,6 +85,8 @@ static struct sunxi_usb_phy {
 #endif
 };
 
+static int initial_usb_scan_delay = CONFIG_INITIAL_USB_SCAN_DELAY;
+
 static int get_vbus_gpio(int index)
 {
        switch (index) {
@@ -144,12 +146,13 @@ __maybe_unused static void usb_phy_write(struct sunxi_usb_phy *phy, int addr,
        }
 }
 
-#if defined CONFIG_MACH_SUN8I_H3
+#if defined(CONFIG_MACH_SUNXI_H3_H5) || defined(CONFIG_MACH_SUN50I)
 static void sunxi_usb_phy_config(struct sunxi_usb_phy *phy)
 {
+#if defined CONFIG_MACH_SUNXI_H3_H5
        if (phy->id == 0)
                clrbits_le32(SUNXI_USBPHY_BASE + REG_PHY_UNK_H3, 0x01);
-
+#endif
        clrbits_le32(phy->base + REG_PMU_UNK_H3, 0x02);
 }
 #elif defined CONFIG_MACH_SUN8I_A83T
@@ -269,6 +272,11 @@ void sunxi_usb_phy_power_on(int index)
 {
        struct sunxi_usb_phy *phy = &sunxi_usb_phy[index];
 
+       if (initial_usb_scan_delay) {
+               mdelay(initial_usb_scan_delay);
+               initial_usb_scan_delay = 0;
+       }
+
        phy->power_on_count++;
        if (phy->power_on_count != 1)
                return;
@@ -289,13 +297,6 @@ void sunxi_usb_phy_power_off(int index)
                gpio_set_value(phy->gpio_vbus, 0);
 }
 
-int sunxi_usb_phy_power_is_on(int index)
-{
-       struct sunxi_usb_phy *phy = &sunxi_usb_phy[index];
-
-       return phy->power_on_count > 0;
-}
-
 int sunxi_usb_phy_vbus_detect(int index)
 {
        struct sunxi_usb_phy *phy = &sunxi_usb_phy[index];