aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRobby Cai <R63905@freescale.com>2013-11-06 03:21:08 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:11:56 -0400
commitd0be304b51338c950aabc51daa499a80be1f2713 (patch)
tree691854e8559b56673f4b94ecb16d6aec2f9e479e /drivers/video
parent3a9b3a5e8184de603ba6adbd5527caf97073cbf3 (diff)
ENGR00286462 mx6sl fb: fix runtime pm not work at probe time
For mxsfb, the lcdif controller is enabled (with clock enabled as well) at probe time, but pm_runtime_enable() is called after its enablement, thus runtime pm function only works at next enablement. The root cause is that pm_runtime_get_sync() function need to be called after pm_runtime_enable(). This patch fixes the problem by moving the position of pm_runtime_enable() ahead. For epdc fb, runtime pm may not work at probe time if DEFAULT_PANEL_HW_INIT is turned on (off by default). Fix it for safety. Signed-off-by: Robby Cai <R63905@freescale.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/mxc/mxc_epdc_fb.c4
-rw-r--r--drivers/video/mxsfb.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_epdc_fb.c
index a57c95914fb6..e536e781db9e 100644
--- a/drivers/video/mxc/mxc_epdc_fb.c
+++ b/drivers/video/mxc/mxc_epdc_fb.c
@@ -5013,6 +5013,8 @@ int mxc_epdc_fb_probe(struct platform_device *pdev)
5013 5013
5014 g_fb_data = fb_data; 5014 g_fb_data = fb_data;
5015 5015
5016 pm_runtime_enable(fb_data->dev);
5017
5016#ifdef DEFAULT_PANEL_HW_INIT 5018#ifdef DEFAULT_PANEL_HW_INIT
5017 ret = mxc_epdc_fb_init_hw((struct fb_info *)fb_data); 5019 ret = mxc_epdc_fb_init_hw((struct fb_info *)fb_data);
5018 if (ret) { 5020 if (ret) {
@@ -5020,8 +5022,6 @@ int mxc_epdc_fb_probe(struct platform_device *pdev)
5020 } 5022 }
5021#endif 5023#endif
5022 5024
5023 pm_runtime_enable(fb_data->dev);
5024
5025 goto out; 5025 goto out;
5026 5026
5027out_lutmap: 5027out_lutmap:
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index c4d0b6cc8b18..a9b9ef2f5682 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -1204,9 +1204,11 @@ static int mxsfb_probe(struct platform_device *pdev)
1204 1204
1205 INIT_LIST_HEAD(&fb_info->modelist); 1205 INIT_LIST_HEAD(&fb_info->modelist);
1206 1206
1207 pm_runtime_enable(&host->pdev->dev);
1208
1207 ret = mxsfb_init_fbinfo(host); 1209 ret = mxsfb_init_fbinfo(host);
1208 if (ret != 0) 1210 if (ret != 0)
1209 goto fb_release; 1211 goto fb_pm_runtime_disable;
1210 1212
1211 platform_set_drvdata(pdev, fb_info); 1213 platform_set_drvdata(pdev, fb_info);
1212 1214
@@ -1222,8 +1224,6 @@ static int mxsfb_probe(struct platform_device *pdev)
1222 goto fb_destroy; 1224 goto fb_destroy;
1223 } 1225 }
1224 1226
1225 pm_runtime_enable(&host->pdev->dev);
1226
1227 dev_info(&pdev->dev, "initialized\n"); 1227 dev_info(&pdev->dev, "initialized\n");
1228 1228
1229 return 0; 1229 return 0;
@@ -1232,6 +1232,8 @@ fb_destroy:
1232 if (host->enabled) 1232 if (host->enabled)
1233 clk_disable_unprepare(host->clk_pix); 1233 clk_disable_unprepare(host->clk_pix);
1234 fb_destroy_modelist(&fb_info->modelist); 1234 fb_destroy_modelist(&fb_info->modelist);
1235fb_pm_runtime_disable:
1236 pm_runtime_disable(&host->pdev->dev);
1235fb_release: 1237fb_release:
1236 framebuffer_release(fb_info); 1238 framebuffer_release(fb_info);
1237 1239
@@ -1246,6 +1248,7 @@ static int mxsfb_remove(struct platform_device *pdev)
1246 if (host->enabled) 1248 if (host->enabled)
1247 mxsfb_disable_controller(fb_info); 1249 mxsfb_disable_controller(fb_info);
1248 1250
1251 pm_runtime_disable(&host->pdev->dev);
1249 unregister_framebuffer(fb_info); 1252 unregister_framebuffer(fb_info);
1250 mxsfb_free_videomem(host); 1253 mxsfb_free_videomem(host);
1251 1254