Skip to content

Commit 27f3d3f

Browse files
andredvinodkoul
authored andcommitted
phy: exynos5-usbdrd: convert udelay() to fsleep()
The timers-howto recommends using usleep_range() and friends anytime waiting for >= ~10us is required. Doing so can help the timer subsystem a lot to coalesce wakeups. Additionally, fsleep() exists as a convenient wrapper so we do not have to think about which exact sleeping function is required in which case. Convert all udelay() calls in this driver to use fsleep() to follow the recommendataion. Signed-off-by: André Draszik <[email protected]> Reviewed-by: Peter Griffin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 2a0dc34 commit 27f3d3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/phy/samsung/phy-exynos5-usbdrd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static int exynos5_usbdrd_phy_init(struct phy *phy)
448448

449449
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST);
450450

451-
udelay(10);
451+
fsleep(10);
452452

453453
reg &= ~PHYCLKRST_PORTRESET;
454454
writel(reg, phy_drd->reg_phy + EXYNOS5_DRD_PHYCLKRST);
@@ -779,11 +779,11 @@ static void exynos850_usbdrd_utmi_init(struct exynos5_usbdrd_phy *phy_drd)
779779
writel(reg, regs_base + EXYNOS850_DRD_HSP_TEST);
780780

781781
/* Finish PHY reset (POR=low) */
782-
udelay(10); /* required before doing POR=low */
782+
fsleep(10); /* required before doing POR=low */
783783
reg = readl(regs_base + EXYNOS850_DRD_CLKRST);
784784
reg &= ~(CLKRST_PHY_SW_RST | CLKRST_PORT_RST);
785785
writel(reg, regs_base + EXYNOS850_DRD_CLKRST);
786-
udelay(75); /* required after POR=low for guaranteed PHY clock */
786+
fsleep(75); /* required after POR=low for guaranteed PHY clock */
787787

788788
/* Disable single ended signal out */
789789
reg = readl(regs_base + EXYNOS850_DRD_HSP);
@@ -836,7 +836,7 @@ static int exynos850_usbdrd_phy_exit(struct phy *phy)
836836
reg = readl(regs_base + EXYNOS850_DRD_CLKRST);
837837
reg |= CLKRST_LINK_SW_RST;
838838
writel(reg, regs_base + EXYNOS850_DRD_CLKRST);
839-
udelay(10); /* required before doing POR=low */
839+
fsleep(10); /* required before doing POR=low */
840840
reg &= ~CLKRST_LINK_SW_RST;
841841
writel(reg, regs_base + EXYNOS850_DRD_CLKRST);
842842

0 commit comments

Comments
 (0)