Commit 4ad3041d authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'imx-fixes-3.8-3' of git://git.linaro.org/people/shawnguo/linux-2.6 into fixes

From Shawn Guo:

This is yet another critical imxfb fixes held off by absence of FB
maintainer for some time.

* tag 'imx-fixes-3.8-3' of git://git.linaro.org/people/shawnguo/linux-2.6:
  video: imxfb: Do not crash on reboot
parents f6be19c8 e6b267ce
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ struct imxfb_info {
	struct clk		*clk_ahb;
	struct clk		*clk_per;
	enum imxfb_type		devtype;
	bool			enabled;

	/*
	 * These are the addresses we mapped
@@ -536,6 +537,10 @@ static void imxfb_exit_backlight(struct imxfb_info *fbi)

static void imxfb_enable_controller(struct imxfb_info *fbi)
{

	if (fbi->enabled)
		return;

	pr_debug("Enabling LCD controller\n");

	writel(fbi->screen_dma, fbi->regs + LCDC_SSA);
@@ -556,6 +561,7 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)
	clk_prepare_enable(fbi->clk_ipg);
	clk_prepare_enable(fbi->clk_ahb);
	clk_prepare_enable(fbi->clk_per);
	fbi->enabled = true;

	if (fbi->backlight_power)
		fbi->backlight_power(1);
@@ -565,6 +571,9 @@ static void imxfb_enable_controller(struct imxfb_info *fbi)

static void imxfb_disable_controller(struct imxfb_info *fbi)
{
	if (!fbi->enabled)
		return;

	pr_debug("Disabling LCD controller\n");

	if (fbi->backlight_power)
@@ -575,6 +584,7 @@ static void imxfb_disable_controller(struct imxfb_info *fbi)
	clk_disable_unprepare(fbi->clk_per);
	clk_disable_unprepare(fbi->clk_ipg);
	clk_disable_unprepare(fbi->clk_ahb);
	fbi->enabled = false;

	writel(0, fbi->regs + LCDC_RMCR);
}