summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-01-23 20:35:02 -0800
committerOlof Johansson <olof@lixom.net>2013-01-23 20:35:02 -0800
commit4ad3041d3b76632c02b50aa384a8f21d7d15bac0 (patch)
tree5b43d0934d8328a15498c6898c56ec71e020ccd1 /drivers
parentf6be19c8bcca7185dcbda61f34f99d8b15bcd165 (diff)
parente6b267ce14f61d9da0151b97ee26ab4d38055567 (diff)
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
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/imxfb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 600f6f9987cc..0abf2bf20836 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -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);
}