Commit 99c796df94afca5256860dd4760017f1dbb3480c
1 parent
41e2e8fd34
Exists in
master
and in
39 other branches
VIDEO: amba clcd: don't disable an already disabled clock
Fix the clock enable/disable tracking in the AMBA CLCD driver so that the driver doesn't try to disable an already disabled clock, thereby causing the clock (if shared) to become unbalanced. This resolves a problem with CLCD on LPC32xx ARM platforms. Reported-by: Kevin Wells <wellsk40@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Showing 2 changed files with 9 additions and 2 deletions Side-by-side Diff
drivers/video/amba-clcd.c
... | ... | @@ -80,7 +80,10 @@ |
80 | 80 | /* |
81 | 81 | * Disable CLCD clock source. |
82 | 82 | */ |
83 | - clk_disable(fb->clk); | |
83 | + if (fb->clk_enabled) { | |
84 | + fb->clk_enabled = false; | |
85 | + clk_disable(fb->clk); | |
86 | + } | |
84 | 87 | } |
85 | 88 | |
86 | 89 | static void clcdfb_enable(struct clcd_fb *fb, u32 cntl) |
... | ... | @@ -88,7 +91,10 @@ |
88 | 91 | /* |
89 | 92 | * Enable the CLCD clock source. |
90 | 93 | */ |
91 | - clk_enable(fb->clk); | |
94 | + if (!fb->clk_enabled) { | |
95 | + fb->clk_enabled = true; | |
96 | + clk_enable(fb->clk); | |
97 | + } | |
92 | 98 | |
93 | 99 | /* |
94 | 100 | * Bring up by first enabling.. |