USB: phy: tegra: replace mdelay with usleep_range
Suresh Mangipudi [Mon, 30 Jun 2014 07:44:15 +0000 (12:44 +0530)]
Avoid busy waiting by using usleep_range().

Change-Id: If11f137d5bc1a67e37e232996cac559b7b154545
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/432645
(cherry picked from commit 067e4086801c0805846969b8473999afe7b7dd03)
Reviewed-on: http://git-master/r/434624
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/usb/phy/tegra11x_usb_phy.c

index e340ce1..96a1e6d 100644 (file)
@@ -1259,14 +1259,14 @@ static void utmi_phy_restore_end(struct tegra_usb_phy *phy)
 
                /* Add delay sothat resume will be driven for more than 20 ms */
                if (phy->port_speed != USB_PHY_PORT_SPEED_FULL) {
-                       mdelay(10);
+                       usleep_range(10000, 11000);
                        local_irq_save(flags);
                        pmc->pmc_ops->disable_pmc_bus_ctrl(pmc, 1);
                        phy->pmc_remote_wakeup = false;
                        phy->pmc_hotplug_wakeup = false;
                        local_irq_restore(flags);
                } else {
-                       mdelay(25);
+                       usleep_range(25000, 26000);
                        local_irq_save(flags);
                        pmc->pmc_ops->disable_pmc_bus_ctrl(pmc, 0);
                        phy->pmc_remote_wakeup = false;
@@ -1671,7 +1671,7 @@ static bool utmi_phy_qc2_charger_detect(struct tegra_usb_phy *phy,
                        __func__, __LINE__, phy->inst);
 
                /* Wall charger needs time before setting D+/D- */
-               mdelay(25);
+               usleep_range(25000, 26000);
 
                switch (max_voltage) {
                case TEGRA_USB_QC2_9V:
@@ -2118,10 +2118,10 @@ static void uhsic_phy_restore_end(struct tegra_usb_phy *phy)
 
        if (irq_disabled) {
                local_irq_restore(flags);
-               mdelay(25);
+               usleep_range(25000, 26000);
                local_irq_save(flags);
        } else
-               mdelay(10);
+               usleep_range(10000, 11000);
 
        pmc->pmc_ops->disable_pmc_bus_ctrl(pmc, 1);
        phy->pmc_remote_wakeup = false;