This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: imx-jpeg: Add pm-sleep support for imx-jpeg
Author:  Ming Qian <[email protected]>
Date:    Wed Apr 6 10:47:03 2022 +0100

Wait finishing jpeg job before system sleep,
otherwise the encoding/decoding can't be resumed after suspend.

Signed-off-by: Ming Qian <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

---

diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c 
b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index c9ca7577140c..9ce1e78f5d30 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -2209,9 +2209,33 @@ static int mxc_jpeg_runtime_suspend(struct device *dev)
 }
 #endif
 
+#ifdef CONFIG_PM_SLEEP
+static int mxc_jpeg_suspend(struct device *dev)
+{
+       struct mxc_jpeg_dev *jpeg = dev_get_drvdata(dev);
+
+       v4l2_m2m_suspend(jpeg->m2m_dev);
+       return pm_runtime_force_suspend(dev);
+}
+
+static int mxc_jpeg_resume(struct device *dev)
+{
+       struct mxc_jpeg_dev *jpeg = dev_get_drvdata(dev);
+       int ret;
+
+       ret = pm_runtime_force_resume(dev);
+       if (ret < 0)
+               return ret;
+
+       v4l2_m2m_resume(jpeg->m2m_dev);
+       return ret;
+}
+#endif
+
 static const struct dev_pm_ops mxc_jpeg_pm_ops = {
        SET_RUNTIME_PM_OPS(mxc_jpeg_runtime_suspend,
                           mxc_jpeg_runtime_resume, NULL)
+       SET_SYSTEM_SLEEP_PM_OPS(mxc_jpeg_suspend, mxc_jpeg_resume)
 };
 
 static int mxc_jpeg_remove(struct platform_device *pdev)

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to