MLK-16581-3 drm/imx: ldb: Get bypass & pixel clock rates before setting their rates
authorLiu Ying <victor.liu@nxp.com>
Fri, 13 Oct 2017 04:30:46 +0000 (12:30 +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 bypass 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/drm/imx/imx-ldb.c

index def0e33..a27f8b1 100644 (file)
@@ -257,6 +257,15 @@ static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno,
        int ret;
 
        if (ldb->is_imx8) {
+               /*
+                * 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(ldb->clk_bypass);
+               clk_get_rate(ldb->clk_pixel);
                clk_set_rate(ldb->clk_bypass, di_clk);
                clk_set_rate(ldb->clk_pixel, di_clk);
                return;