MLK-11594 video: mxsfb: correct the pm runtime logic
authorFancy Fang <chen.fang@freescale.com>
Mon, 21 Sep 2015 07:37:08 +0000 (15:37 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:35 +0000 (14:48 -0500)
The pm power's usage_count should be first added by
one before putting it into suspend state. Otherwise
the usage_count will be negative and the power cannot
be put into suspend state correctly.

Signed-off-by: Fancy Fang <chen.fang@freescale.com>
(cherry picked from commit a48460b41399112f5d3ae03b30e3f9e885346ff7)

Conflicts:
drivers/video/mxsfb.c

drivers/video/fbdev/mxsfb.c

index 1b9bdfa..6f36172 100644 (file)
@@ -896,9 +896,7 @@ static int mxsfb_blank(int blank, struct fb_info *fb_info)
        case FB_BLANK_NORMAL:
                if (host->enabled) {
                        mxsfb_disable_controller(fb_info);
-                       pm_runtime_put_noidle(&host->pdev->dev);
                        pm_runtime_put_sync_suspend(&host->pdev->dev);
-                       pm_runtime_get_noresume(&host->pdev->dev);
                }
 
                clk_disable_disp_axi(host);
@@ -1478,6 +1476,7 @@ static int mxsfb_probe(struct platform_device *pdev)
                writel(0, host->base + LCDC_CTRL);
                mxsfb_set_par(fb_info);
                mxsfb_enable_controller(fb_info);
+               pm_runtime_get_sync(&host->pdev->dev);
        }
 
        ret = register_framebuffer(fb_info);