Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99c796df authored by Russell King's avatar Russell King
Browse files

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: default avatarKevin Wells <wellsk40@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 41e2e8fd
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -80,15 +80,21 @@ static void clcdfb_disable(struct clcd_fb *fb)
	/*
	/*
	 * Disable CLCD clock source.
	 * Disable CLCD clock source.
	 */
	 */
	if (fb->clk_enabled) {
		fb->clk_enabled = false;
		clk_disable(fb->clk);
		clk_disable(fb->clk);
	}
	}
}


static void clcdfb_enable(struct clcd_fb *fb, u32 cntl)
static void clcdfb_enable(struct clcd_fb *fb, u32 cntl)
{
{
	/*
	/*
	 * Enable the CLCD clock source.
	 * Enable the CLCD clock source.
	 */
	 */
	if (!fb->clk_enabled) {
		fb->clk_enabled = true;
		clk_enable(fb->clk);
		clk_enable(fb->clk);
	}


	/*
	/*
	 * Bring up by first enabling..
	 * Bring up by first enabling..
+1 −0
Original line number Original line Diff line number Diff line
@@ -150,6 +150,7 @@ struct clcd_fb {
	u16			off_cntl;
	u16			off_cntl;
	u32			clcd_cntl;
	u32			clcd_cntl;
	u32			cmap[16];
	u32			cmap[16];
	bool			clk_enabled;
};
};


static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)