MLK-19017-6 drm/imx: add system pm support for SEC DSIM
authorFancy Fang <chen.fang@nxp.com>
Mon, 2 Jul 2018 10:41:16 +0000 (18:41 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Implement the suspend()/resume() callbacks to support system
power management functions for SEC DSIM.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit db3e9faa0278af6de5aaac008478123d0ebecb73)
(cherry picked from commit 549fb9fb7d4e29e72f4a5da707b3a378ee81081d)

drivers/gpu/drm/imx/sec_mipi_dsim-imx.c

index 4edff1c..e57451d 100644 (file)
@@ -55,6 +55,20 @@ struct imx_sec_dsim_device {
 
 static struct imx_sec_dsim_device *dsim_dev;
 
+#if CONFIG_PM
+static int imx_sec_dsim_runtime_suspend(struct device *dev);
+static int imx_sec_dsim_runtime_resume(struct device *dev);
+#else
+static int imx_sec_dsim_runtime_suspend(struct device *dev)
+{
+       return 0;
+}
+static int imx_sec_dsim_runtime_resume(struct device *dev)
+{
+       return 0;
+}
+#endif
+
 static void disp_mix_dsim_soft_reset_release(struct regmap *gpr, bool release)
 {
        if (release)
@@ -251,6 +265,16 @@ static int imx_sec_dsim_remove(struct platform_device *pdev)
 
 #ifdef CONFIG_PM_SLEEP
 static int imx_sec_dsim_suspend(struct device *dev)
+{
+       return imx_sec_dsim_runtime_suspend(dev);
+}
+
+static int imx_sec_dsim_resume(struct device *dev)
+{
+       return imx_sec_dsim_runtime_resume(dev);
+}
+#else
+static int imx_sec_dsim_suspend(struct device *dev)
 {
        return 0;
 }