From: dkl Date: Tue, 3 Feb 2015 06:15:27 +0000 (+0800) Subject: rk3288: modify to ensure pairwise call of clk_enable\disable X-Git-Tag: firefly_0821_release~4263^2~60 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ea38e66b9df491f73c1c1de55085f332168a00d0;p=firefly-linux-kernel-4.4.55.git rk3288: modify to ensure pairwise call of clk_enable\disable in rk3288_pll_early_suspend_notifier_call Signed-off-by: dkl --- diff --git a/arch/arm/mach-rockchip/rk3288.c b/arch/arm/mach-rockchip/rk3288.c index de229db2a63a..04af8772d603 100755 --- a/arch/arm/mach-rockchip/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288.c @@ -504,12 +504,16 @@ static int rk3288_pll_early_suspend_notifier_call(struct notifier_block *self, { struct fb_event *event = data; int blank_mode = *((int *)event->data); + static bool enable = false; if (action == FB_EARLY_EVENT_BLANK) { switch (blank_mode) { case FB_BLANK_UNBLANK: - clk_prepare_enable(clk_get_sys(NULL, "clk_cpll")); - clk_prepare_enable(clk_get_sys(NULL, "clk_npll")); + if (!enable) { + clk_prepare_enable(clk_get_sys(NULL, "clk_cpll")); + clk_prepare_enable(clk_get_sys(NULL, "clk_npll")); + enable = true; + } break; default: break; @@ -517,8 +521,11 @@ static int rk3288_pll_early_suspend_notifier_call(struct notifier_block *self, } else if (action == FB_EVENT_BLANK) { switch (blank_mode) { case FB_BLANK_POWERDOWN: - clk_disable_unprepare(clk_get_sys(NULL, "clk_cpll")); - clk_disable_unprepare(clk_get_sys(NULL, "clk_npll")); + if (enable) { + clk_disable_unprepare(clk_get_sys(NULL, "clk_cpll")); + clk_disable_unprepare(clk_get_sys(NULL, "clk_npll")); + enable = false; + } break; default: break;