MLK-19017-3 gpu: imx: add system pm support for LCDIF
authorFancy Fang <chen.fang@nxp.com>
Mon, 2 Jul 2018 09:37:37 +0000 (17:37 +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 LCDIF.

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

drivers/gpu/imx/lcdif/lcdif-common.c

index 3ce84b5..863cb62 100644 (file)
@@ -85,6 +85,20 @@ static const struct of_device_id imx_lcdif_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, lcdif_dt_ids);
 
+#ifdef CONFIG_PM
+static int imx_lcdif_runtime_suspend(struct device *dev);
+static int imx_lcdif_runtime_resume(struct device *dev);
+#else
+static int imx_lcdif_runtime_suspend(struct device *dev)
+{
+       return 0;
+}
+static int imx_lcdif_runtime_resume(struct device *dev)
+{
+       return 0;
+}
+#endif
+
 void disp_mix_bus_rstn_reset(struct regmap *gpr, bool reset)
 {
        if (!reset)
@@ -614,9 +628,18 @@ static int imx_lcdif_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int imx_lcdif_suspend(struct device *dev)
 {
-       return 0;
+       return imx_lcdif_runtime_suspend(dev);
 }
 
+static int imx_lcdif_resume(struct device *dev)
+{
+       return imx_lcdif_runtime_resume(dev);
+}
+#else
+static int imx_lcdif_suspend(struct device *dev)
+{
+       return 0;
+}
 static int imx_lcdif_resume(struct device *dev)
 {
        return 0;