Skip to content

Commit

Permalink
Merge tag 'imx-fixes-3.8-3' of git://git.linaro.org/people/shawnguo/l…
Browse files Browse the repository at this point in the history
…inux-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
  • Loading branch information
Olof Johansson committed Jan 24, 2013
2 parents f6be19c + e6b267c commit 4ad3041
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/video/imxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit 4ad3041

Please sign in to comment.