aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2017-09-19 06:01:08 -0400
committerStephen Boyd <sboyd@codeaurora.org>2017-10-04 12:19:13 -0400
commit5dcbeca615ef12047a5f4097b91030cbf995b1d2 (patch)
treee2f6321a97526da05523ba608f9e0ea606210f0e /drivers
parent79765e9a3d9966dc35a35a1a9c50afcd6a2dc354 (diff)
clk: samsung: exynos4: Enable VPLL and EPLL clocks for suspend/resume cycle
Commit 6edfa11cb396 ("clk: samsung: Add enable/disable operation for PLL36XX clocks") added enable/disable operations to PLL clocks. Prior that VPLL and EPPL clocks were always enabled because the enable bit was never touched. Those clocks have to be enabled during suspend/resume cycle, because otherwise board fails to enter sleep mode. This patch enables them unconditionally before entering system suspend state. System restore function will set them to the previous state saved in the register cache done before that unconditional enable. Fixes: 6edfa11cb396 ("clk: samsung: Add enable/disable operation for PLL36XX clocks") CC: stable@vger.kernel.org # v4.13 Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/samsung/clk-exynos4.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index e40b77583c47..d8d3cb67b402 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -294,6 +294,18 @@ static const struct samsung_clk_reg_dump src_mask_suspend_e4210[] = {
294#define PLL_ENABLED (1 << 31) 294#define PLL_ENABLED (1 << 31)
295#define PLL_LOCKED (1 << 29) 295#define PLL_LOCKED (1 << 29)
296 296
297static void exynos4_clk_enable_pll(u32 reg)
298{
299 u32 pll_con = readl(reg_base + reg);
300 pll_con |= PLL_ENABLED;
301 writel(pll_con, reg_base + reg);
302
303 while (!(pll_con & PLL_LOCKED)) {
304 cpu_relax();
305 pll_con = readl(reg_base + reg);
306 }
307}
308
297static void exynos4_clk_wait_for_pll(u32 reg) 309static void exynos4_clk_wait_for_pll(u32 reg)
298{ 310{
299 u32 pll_con; 311 u32 pll_con;
@@ -315,6 +327,9 @@ static int exynos4_clk_suspend(void)
315 samsung_clk_save(reg_base, exynos4_save_pll, 327 samsung_clk_save(reg_base, exynos4_save_pll,
316 ARRAY_SIZE(exynos4_clk_pll_regs)); 328 ARRAY_SIZE(exynos4_clk_pll_regs));
317 329
330 exynos4_clk_enable_pll(EPLL_CON0);
331 exynos4_clk_enable_pll(VPLL_CON0);
332
318 if (exynos4_soc == EXYNOS4210) { 333 if (exynos4_soc == EXYNOS4210) {
319 samsung_clk_save(reg_base, exynos4_save_soc, 334 samsung_clk_save(reg_base, exynos4_save_soc,
320 ARRAY_SIZE(exynos4210_clk_save)); 335 ARRAY_SIZE(exynos4210_clk_save));