diff options
Diffstat (limited to 'arch/arm/mach-imx/clk-pllv3.c')
-rw-r--r-- | arch/arm/mach-imx/clk-pllv3.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c index a9fad5f8d340..f6640b6a7b31 100644 --- a/arch/arm/mach-imx/clk-pllv3.c +++ b/arch/arm/mach-imx/clk-pllv3.c | |||
@@ -48,7 +48,7 @@ struct clk_pllv3 { | |||
48 | static int clk_pllv3_prepare(struct clk_hw *hw) | 48 | static int clk_pllv3_prepare(struct clk_hw *hw) |
49 | { | 49 | { |
50 | struct clk_pllv3 *pll = to_clk_pllv3(hw); | 50 | struct clk_pllv3 *pll = to_clk_pllv3(hw); |
51 | unsigned long timeout = jiffies + msecs_to_jiffies(10); | 51 | unsigned long timeout; |
52 | u32 val; | 52 | u32 val; |
53 | 53 | ||
54 | val = readl_relaxed(pll->base); | 54 | val = readl_relaxed(pll->base); |
@@ -59,12 +59,19 @@ static int clk_pllv3_prepare(struct clk_hw *hw) | |||
59 | val &= ~BM_PLL_POWER; | 59 | val &= ~BM_PLL_POWER; |
60 | writel_relaxed(val, pll->base); | 60 | writel_relaxed(val, pll->base); |
61 | 61 | ||
62 | timeout = jiffies + msecs_to_jiffies(10); | ||
62 | /* Wait for PLL to lock */ | 63 | /* Wait for PLL to lock */ |
63 | while (!(readl_relaxed(pll->base) & BM_PLL_LOCK)) | 64 | do { |
65 | if (readl_relaxed(pll->base) & BM_PLL_LOCK) | ||
66 | break; | ||
64 | if (time_after(jiffies, timeout)) | 67 | if (time_after(jiffies, timeout)) |
65 | return -ETIMEDOUT; | 68 | break; |
69 | } while (1); | ||
66 | 70 | ||
67 | return 0; | 71 | if (readl_relaxed(pll->base) & BM_PLL_LOCK) |
72 | return 0; | ||
73 | else | ||
74 | return -ETIMEDOUT; | ||
68 | } | 75 | } |
69 | 76 | ||
70 | static void clk_pllv3_unprepare(struct clk_hw *hw) | 77 | static void clk_pllv3_unprepare(struct clk_hw *hw) |