mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
media: nxp: imx8-isi: Add suspend/resume support for ISI mem2mem
Add suspend/resume support for ISI when work at memory to memory mode. Link: https://lore.kernel.org/r/20250815-isi_m2m-v2-1-32e3720880cc@nxp.com Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
9a21ffeade
commit
45854b1e59
|
|
@ -374,6 +374,8 @@ static int mxc_isi_pm_suspend(struct device *dev)
|
|||
mxc_isi_video_suspend(pipe);
|
||||
}
|
||||
|
||||
mxc_isi_m2m_suspend(&isi->m2m);
|
||||
|
||||
return pm_runtime_force_suspend(dev);
|
||||
}
|
||||
|
||||
|
|
@ -403,6 +405,12 @@ static int mxc_isi_pm_resume(struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
ret = mxc_isi_m2m_resume(&isi->m2m);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to resume ISI (%d) for m2m\n", ret);
|
||||
err = ret;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -342,6 +342,8 @@ int mxc_isi_video_buffer_prepare(struct mxc_isi_dev *isi, struct vb2_buffer *vb2
|
|||
#ifdef CONFIG_VIDEO_IMX8_ISI_M2M
|
||||
int mxc_isi_m2m_register(struct mxc_isi_dev *isi, struct v4l2_device *v4l2_dev);
|
||||
int mxc_isi_m2m_unregister(struct mxc_isi_dev *isi);
|
||||
void mxc_isi_m2m_suspend(struct mxc_isi_m2m *m2m);
|
||||
int mxc_isi_m2m_resume(struct mxc_isi_m2m *m2m);
|
||||
#else
|
||||
static inline int mxc_isi_m2m_register(struct mxc_isi_dev *isi,
|
||||
struct v4l2_device *v4l2_dev)
|
||||
|
|
@ -352,6 +354,13 @@ static inline int mxc_isi_m2m_unregister(struct mxc_isi_dev *isi)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void mxc_isi_m2m_suspend(struct mxc_isi_m2m *m2m)
|
||||
{
|
||||
}
|
||||
static inline int mxc_isi_m2m_resume(struct mxc_isi_m2m *m2m)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int mxc_isi_channel_acquire(struct mxc_isi_pipe *pipe,
|
||||
|
|
|
|||
|
|
@ -730,6 +730,40 @@ static const struct v4l2_file_operations mxc_isi_m2m_fops = {
|
|||
.mmap = v4l2_m2m_fop_mmap,
|
||||
};
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Suspend & resume
|
||||
*/
|
||||
|
||||
void mxc_isi_m2m_suspend(struct mxc_isi_m2m *m2m)
|
||||
{
|
||||
if (m2m->usage_count == 0)
|
||||
return;
|
||||
|
||||
v4l2_m2m_suspend(m2m->m2m_dev);
|
||||
|
||||
if (m2m->chained_count > 0)
|
||||
mxc_isi_channel_unchain(m2m->pipe);
|
||||
|
||||
mxc_isi_channel_disable(m2m->pipe);
|
||||
mxc_isi_channel_put(m2m->pipe);
|
||||
}
|
||||
|
||||
int mxc_isi_m2m_resume(struct mxc_isi_m2m *m2m)
|
||||
{
|
||||
if (m2m->usage_count == 0)
|
||||
return 0;
|
||||
|
||||
mxc_isi_channel_get(m2m->pipe);
|
||||
|
||||
if (m2m->chained_count > 0)
|
||||
mxc_isi_channel_chain(m2m->pipe);
|
||||
|
||||
m2m->last_ctx = NULL;
|
||||
v4l2_m2m_resume(m2m->m2m_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Registration
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user