]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
USB: phy: tegra: replace mdelay with usleep_range
authorSuresh Mangipudi <smangipudi@nvidia.com>
Mon, 30 Jun 2014 08:12:41 +0000 (13:42 +0530)
committerPradeep Thiruchelvam <pradeept@nvidia.com>
Thu, 3 Jul 2014 02:59:30 +0000 (19:59 -0700)
Avoid busy waiting by using usleep_range().

Change-Id: Ifba64bda667001d4de837e10ddb36f8f7d23312e
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/432651
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Robert Shih <rshih@nvidia.com>
Reviewed-by: Chas Inman <chasi@nvidia.com>
drivers/usb/phy/tegra11x_usb_phy.c

index e6232ca5a933a2918e41bff6f2e67a1cfb7f49b6..a309f759e70d131db1d09f52101f5b962ba0fa24 100644 (file)
@@ -1262,14 +1262,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;
@@ -1674,7 +1674,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:
@@ -2104,10 +2104,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;