mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 10:31:54 +00:00
media: platform: Improve the implementation of the system PM ops
Add v4l2_m2m_suspend() function call in mtk_jpeg_suspend() to make sure that the current frame is processed completely before suspend. Add v4l2_m2m_resume() function call in mtk_jpeg_resume() to unblock the driver from scheduling next frame. Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Xia Jiang <xia.jiang@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
911ea8ec42
commit
f9f964519c
@ -1207,24 +1207,22 @@ static __maybe_unused int mtk_jpeg_pm_resume(struct device *dev)
|
||||
|
||||
static __maybe_unused int mtk_jpeg_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
struct mtk_jpeg_dev *jpeg = dev_get_drvdata(dev);
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
|
||||
ret = mtk_jpeg_pm_suspend(dev);
|
||||
return ret;
|
||||
v4l2_m2m_suspend(jpeg->m2m_dev);
|
||||
return pm_runtime_force_suspend(dev);
|
||||
}
|
||||
|
||||
static __maybe_unused int mtk_jpeg_resume(struct device *dev)
|
||||
{
|
||||
struct mtk_jpeg_dev *jpeg = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
if (pm_runtime_suspended(dev))
|
||||
return 0;
|
||||
|
||||
ret = mtk_jpeg_pm_resume(dev);
|
||||
ret = pm_runtime_force_resume(dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
v4l2_m2m_resume(jpeg->m2m_dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user