summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFancy Fang <chen.fang@freescale.com>2015-07-13 16:34:28 +0800
committerFancy Fang <chen.fang@freescale.com>2015-07-15 16:24:35 +0800
commit376924bbcd8b792b164749d5db1c432af436e071 (patch)
treea29a305ed87660b9b7f8334ae4f7a79c67f280a8
parent07fcc64681fde93e1a3615b73b6b1094882a16ba (diff)
MLK-11242-2 video: mxsfb: refine lcdif clock management
Remove unnecessary clk enable/disable calls. This will make the driver logic clear and easier to maintaine. Signed-off-by: Fancy Fang <chen.fang@freescale.com>
-rw-r--r--drivers/video/mxsfb.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index e14847b379a7..fbecff75936f 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -531,9 +531,6 @@ static void mxsfb_enable_controller(struct fb_info *fb_info)
pm_runtime_get_sync(&host->pdev->dev);
- clk_enable_axi(host);
- clk_enable_disp_axi(host);
-
/* the pixel clock should be disabled before
* trying to set its clock rate successfully.
*/
@@ -594,8 +591,6 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
if (host->dispdrv && host->dispdrv->drv->disable)
host->dispdrv->drv->disable(host->dispdrv, fb_info);
- clk_enable_axi(host);
- clk_enable_disp_axi(host);
/*
* Even if we disable the controller here, it will still continue
* until its FIFOs are running out of data
@@ -660,10 +655,6 @@ static int mxsfb_set_par(struct fb_info *fb_info)
if (mxsfb_par_equal(fb_info, host))
return 0;
- clk_enable_axi(host);
- clk_enable_disp_axi(host);
- clk_enable_pix(host);
-
dev_dbg(&host->pdev->dev, "%s\n", __func__);
/* If fb is in blank mode, it is
@@ -956,10 +947,6 @@ static int mxsfb_pan_display(struct fb_var_screeninfo *var,
return -EINVAL;
}
- clk_enable_axi(host);
- clk_enable_disp_axi(host);
- clk_enable_pix(host);
-
offset = fb_info->fix.line_length * var->yoffset;
if (down_timeout(&host->flip_sem, HZ / 2)) {
@@ -1541,16 +1528,14 @@ static void mxsfb_shutdown(struct platform_device *pdev)
struct fb_info *fb_info = platform_get_drvdata(pdev);
struct mxsfb_info *host = to_imxfb_host(fb_info);
- clk_enable_axi(host);
- clk_enable_disp_axi(host);
/*
* Force stop the LCD controller as keeping it running during reboot
* might interfere with the BootROM's boot mode pads sampling.
*/
- writel(CTRL_RUN, host->base + LCDC_CTRL + REG_CLR);
- writel(CTRL_MASTER, host->base + LCDC_CTRL + REG_CLR);
- clk_disable_disp_axi(host);
- clk_disable_axi(host);
+ if (host->cur_blank == FB_BLANK_UNBLANK) {
+ writel(CTRL_RUN, host->base + LCDC_CTRL + REG_CLR);
+ writel(CTRL_MASTER, host->base + LCDC_CTRL + REG_CLR);
+ }
}
#ifdef CONFIG_PM_RUNTIME