MLK-19017-5 drm/imx: add DISPMIX power domain support for SEC DSIM
authorFancy Fang <chen.fang@nxp.com>
Mon, 2 Jul 2018 10:33:28 +0000 (18:33 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the SEC DSIM de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe bind anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7a7f17f5fb66135629ef20a2b4780dfef2f0f0ce)
(cherry picked from commit 1f80017f237264f2c84579d8291de210b0ac746c)

drivers/gpu/drm/bridge/sec-dsim.c
drivers/gpu/drm/imx/sec_mipi_dsim-imx.c

index 87262b9..b7f146b 100644 (file)
@@ -314,6 +314,8 @@ struct sec_mipi_dsim {
        const struct sec_mipi_dsim_plat_data *pdata;
 };
 
+static void sec_mipi_dsim_irq_init(struct sec_mipi_dsim *dsim);
+
 /* For now, dsim only support one device attached */
 static int sec_mipi_dsim_host_attach(struct mipi_dsi_host *host,
                                     struct mipi_dsi_device *dsi)
@@ -1189,6 +1191,8 @@ void sec_mipi_dsim_resume(struct device *dev)
 
        clk_prepare_enable(dsim->clk_cfg);
 
+       sec_mipi_dsim_irq_init(dsim);
+
        /* TODO: add dsim de-reset */
 }
 EXPORT_SYMBOL(sec_mipi_dsim_resume);
@@ -1582,7 +1586,6 @@ int sec_mipi_dsim_bind(struct device *dev, struct device *master, void *data,
                        goto cleanup_connector;
        }
 
-       sec_mipi_dsim_irq_init(dsim);
        dev_dbg(dev, "sec-dsim bridge bind end\n");
 
        return 0;
index 245329e..4edff1c 100644 (file)
@@ -216,11 +216,6 @@ static int imx_sec_dsim_bind(struct device *dev, struct device *master,
 
        pm_runtime_enable(dev);
 
-       /* Pull dsim out of reset */
-       disp_mix_dsim_soft_reset_release(dsim_dev->gpr, true);
-       disp_mix_dsim_clks_enable(dsim_dev->gpr, true);
-       imx_sec_dsim_lanes_reset(dsim_dev->gpr, false);
-
        dev_dbg(dev, "%s: dsim bind end\n", __func__);
 
        return 0;
@@ -280,6 +275,11 @@ static int imx_sec_dsim_runtime_resume(struct device *dev)
 {
        request_bus_freq(BUS_FREQ_HIGH);
 
+       /* Pull dsim out of reset */
+       disp_mix_dsim_soft_reset_release(dsim_dev->gpr, true);
+       disp_mix_dsim_clks_enable(dsim_dev->gpr, true);
+       imx_sec_dsim_lanes_reset(dsim_dev->gpr, false);
+
        sec_mipi_dsim_resume(dev);
 
        return 0;