MLK-16581-4 gpu: imx: framegen: Get pll & pixel clock rates before setting their...
authorLiu Ying <victor.liu@nxp.com>
Fri, 13 Oct 2017 04:33:39 +0000 (12:33 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:53 +0000 (15:38 -0500)
Due to i.MX8 clock issue, we need to get pll and pixel clock rates
before setting their rates when system resumes back from PM sleep mode,
otherwise, we'll fail to set the clock rates.  So, this is a workaround
and it can be removed when the clock issue is properly fixed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/imx/dpu/dpu-framegen.c

index e59b8bf..b068e7c 100644 (file)
@@ -279,6 +279,15 @@ void framegen_cfg_videomode(struct dpu_framegen *fg, struct drm_display_mode *m)
                        pll_clock_rate = disp_clock_rate * 8;
        }
 
+       /*
+        * To workaround setting clock rate failure issue
+        * when the system resumes back from PM sleep mode,
+        * we need to get the clock rates before setting
+        * their rates, otherwise, setting the clock rates
+        * will fail.
+        */
+       clk_get_rate(fg->clk_pll);
+       clk_get_rate(fg->clk_disp);
        clk_set_rate(fg->clk_pll, pll_clock_rate);
        clk_set_rate(fg->clk_disp, disp_clock_rate);
 }