* [PATCH] media: chips-media: wave5: Add system suspend/resume support
@ 2026-07-07 20:16 Thorsten Lannynd
2026-07-08 15:23 ` Kendall Willis
0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Lannynd @ 2026-07-07 20:16 UTC (permalink / raw)
To: linux-media
Cc: b-brnich, k-willis, detheridge, Nas Chung, Jackson Lee,
Mauro Carvalho Chehab, linux-kernel
Add SET_SYSTEM_SLEEP_PM_OPS with wave5_system_suspend() and
wave5_system_resume() so the driver handles system suspend to RAM. When
suspended, Wave5 should gracefully finish the job and shutdown. When
resumed, Wave5 should resume the context and finish executing the suspended
stream.
Signed-off-by: Thorsten Lannynd <t-lannynd@ti.com>
---
.../platform/chips-media/wave5/wave5-vpu.c | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 76d57c6b6..a83640751 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -254,7 +254,37 @@ static __maybe_unused int wave5_pm_resume(struct device *dev)
return ret;
}
+static __maybe_unused int wave5_system_suspend(struct device *dev)
+{
+ struct vpu_device *vpu = dev_get_drvdata(dev);
+
+ if (vpu->v4l2_m2m_dec_dev)
+ v4l2_m2m_suspend(vpu->v4l2_m2m_dec_dev);
+ if (vpu->v4l2_m2m_enc_dev)
+ v4l2_m2m_suspend(vpu->v4l2_m2m_enc_dev);
+
+ return pm_runtime_force_suspend(dev);
+}
+
+static __maybe_unused int wave5_system_resume(struct device *dev)
+{
+ struct vpu_device *vpu = dev_get_drvdata(dev);
+ int ret;
+
+ ret = pm_runtime_force_resume(dev);
+ if (ret < 0)
+ return ret;
+
+ if (vpu->v4l2_m2m_dec_dev)
+ v4l2_m2m_resume(vpu->v4l2_m2m_dec_dev);
+ if (vpu->v4l2_m2m_enc_dev)
+ v4l2_m2m_resume(vpu->v4l2_m2m_enc_dev);
+
+ return 0;
+}
+
static const struct dev_pm_ops wave5_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(wave5_system_suspend, wave5_system_resume)
SET_RUNTIME_PM_OPS(wave5_pm_suspend, wave5_pm_resume, NULL)
};
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] media: chips-media: wave5: Add system suspend/resume support
2026-07-07 20:16 [PATCH] media: chips-media: wave5: Add system suspend/resume support Thorsten Lannynd
@ 2026-07-08 15:23 ` Kendall Willis
2026-07-08 16:12 ` Lannynd, Thorsten
0 siblings, 1 reply; 4+ messages in thread
From: Kendall Willis @ 2026-07-08 15:23 UTC (permalink / raw)
To: Thorsten Lannynd
Cc: linux-media, b-brnich, detheridge, Nas Chung, Jackson Lee,
Mauro Carvalho Chehab, linux-kernel
Hi Thorsten,
On 15:16-20260707, Thorsten Lannynd wrote:
> Add SET_SYSTEM_SLEEP_PM_OPS with wave5_system_suspend() and
> wave5_system_resume() so the driver handles system suspend to RAM. When
> suspended, Wave5 should gracefully finish the job and shutdown. When
> resumed, Wave5 should resume the context and finish executing the suspended
> stream.
>
> Signed-off-by: Thorsten Lannynd <t-lannynd@ti.com>
> ---
> .../platform/chips-media/wave5/wave5-vpu.c | 30 +++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index 76d57c6b6..a83640751 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -254,7 +254,37 @@ static __maybe_unused int wave5_pm_resume(struct device *dev)
> return ret;
> }
>
> +static __maybe_unused int wave5_system_suspend(struct device *dev)
> +{
> + struct vpu_device *vpu = dev_get_drvdata(dev);
> +
> + if (vpu->v4l2_m2m_dec_dev)
> + v4l2_m2m_suspend(vpu->v4l2_m2m_dec_dev);
> + if (vpu->v4l2_m2m_enc_dev)
> + v4l2_m2m_suspend(vpu->v4l2_m2m_enc_dev);
> +
> + return pm_runtime_force_suspend(dev);
> +}
> +
> +static __maybe_unused int wave5_system_resume(struct device *dev)
> +{
> + struct vpu_device *vpu = dev_get_drvdata(dev);
> + int ret;
> +
> + ret = pm_runtime_force_resume(dev);
> + if (ret < 0)
> + return ret;
> +
> + if (vpu->v4l2_m2m_dec_dev)
> + v4l2_m2m_resume(vpu->v4l2_m2m_dec_dev);
> + if (vpu->v4l2_m2m_enc_dev)
> + v4l2_m2m_resume(vpu->v4l2_m2m_enc_dev);
Can you confirm that v4l2_m2m_dec_dev can be resumed before
v4l2_m2m_enc_dev? Usually you would suspend devices and resume them in
the opposite order so that you can preserve dependencies.
Best,
Kendall
> +
> + return 0;
> +}
> +
> static const struct dev_pm_ops wave5_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(wave5_system_suspend, wave5_system_resume)
> SET_RUNTIME_PM_OPS(wave5_pm_suspend, wave5_pm_resume, NULL)
> };
>
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] media: chips-media: wave5: Add system suspend/resume support
2026-07-08 15:23 ` Kendall Willis
@ 2026-07-08 16:12 ` Lannynd, Thorsten
2026-07-08 16:22 ` Kendall Willis
0 siblings, 1 reply; 4+ messages in thread
From: Lannynd, Thorsten @ 2026-07-08 16:12 UTC (permalink / raw)
To: Willis, Kendall
Cc: linux-media@vger.kernel.org, Brnich, Brandon, Etheridge, Darren,
Nas Chung, Jackson Lee, Mauro Carvalho Chehab,
linux-kernel@vger.kernel.org
Hi Kendall,
On 07/08/2026 3:23 PM, Kendall Willis wrote:
> Hi Thorsten,
> On 15:16-20260707, Thorsten Lannynd wrote:
> > Add SET_SYSTEM_SLEEP_PM_OPS with wave5_system_suspend() and
> > wave5_system_resume() so the driver handles system suspend to RAM.
> > When suspended, Wave5 should gracefully finish the job and shutdown.
> > When resumed, Wave5 should resume the context and finish executing the
> > suspended stream.
> >
> > Signed-off-by: Thorsten Lannynd <t-lannynd@ti.com>
> > ---
> > .../platform/chips-media/wave5/wave5-vpu.c | 30 +++++++++++++++++++
> > 1 file changed, 30 insertions(+)
> >
> > diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > index 76d57c6b6..a83640751 100644
> > --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > @@ -254,7 +254,37 @@ static __maybe_unused int
> wave5_pm_resume(struct device *dev)
> > return ret;
> > }
> >
> > +static __maybe_unused int wave5_system_suspend(struct device *dev) {
> > + struct vpu_device *vpu = dev_get_drvdata(dev);
> > +
> > + if (vpu->v4l2_m2m_dec_dev)
> > + v4l2_m2m_suspend(vpu->v4l2_m2m_dec_dev);
> > + if (vpu->v4l2_m2m_enc_dev)
> > + v4l2_m2m_suspend(vpu->v4l2_m2m_enc_dev);
> > +
> > + return pm_runtime_force_suspend(dev); }
> > +
> > +static __maybe_unused int wave5_system_resume(struct device *dev) {
> > + struct vpu_device *vpu = dev_get_drvdata(dev);
> > + int ret;
> > +
> > + ret = pm_runtime_force_resume(dev);
> > + if (ret < 0)
> > + return ret;
> > +
> > + if (vpu->v4l2_m2m_dec_dev)
> > + v4l2_m2m_resume(vpu->v4l2_m2m_dec_dev);
> > + if (vpu->v4l2_m2m_enc_dev)
> > + v4l2_m2m_resume(vpu->v4l2_m2m_enc_dev);
>
> Can you confirm that v4l2_m2m_dec_dev can be resumed before
> v4l2_m2m_enc_dev? Usually you would suspend devices and resume them in
> the opposite order so that you can preserve dependencies.
Yes, both devices share the same IP and suspend/resume hooks, so the ordering
should not matter.
Thanks,
Thorsten
> Best,
> Kendall
>
> > +
> > + return 0;
> > +}
> > +
> > static const struct dev_pm_ops wave5_pm_ops = {
> > + SET_SYSTEM_SLEEP_PM_OPS(wave5_system_suspend,
> wave5_system_resume)
> > SET_RUNTIME_PM_OPS(wave5_pm_suspend, wave5_pm_resume,
> NULL) };
> >
> > --
> > 2.34.1
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: chips-media: wave5: Add system suspend/resume support
2026-07-08 16:12 ` Lannynd, Thorsten
@ 2026-07-08 16:22 ` Kendall Willis
0 siblings, 0 replies; 4+ messages in thread
From: Kendall Willis @ 2026-07-08 16:22 UTC (permalink / raw)
To: Lannynd, Thorsten
Cc: linux-media@vger.kernel.org, Brnich, Brandon, Etheridge, Darren,
Nas Chung, Jackson Lee, Mauro Carvalho Chehab,
linux-kernel@vger.kernel.org
On 11:12-20260708, Lannynd, Thorsten wrote:
> Hi Kendall,
> On 07/08/2026 3:23 PM, Kendall Willis wrote:
> > Hi Thorsten,
> > On 15:16-20260707, Thorsten Lannynd wrote:
> > > Add SET_SYSTEM_SLEEP_PM_OPS with wave5_system_suspend() and
> > > wave5_system_resume() so the driver handles system suspend to RAM.
> > > When suspended, Wave5 should gracefully finish the job and shutdown.
> > > When resumed, Wave5 should resume the context and finish executing the
> > > suspended stream.
> > >
> > > Signed-off-by: Thorsten Lannynd <t-lannynd@ti.com>
> > > ---
> > > .../platform/chips-media/wave5/wave5-vpu.c | 30 +++++++++++++++++++
> > > 1 file changed, 30 insertions(+)
> > >
> > > diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > > b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > > index 76d57c6b6..a83640751 100644
> > > --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > > +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > > @@ -254,7 +254,37 @@ static __maybe_unused int
> > wave5_pm_resume(struct device *dev)
> > > return ret;
> > > }
> > >
> > > +static __maybe_unused int wave5_system_suspend(struct device *dev) {
> > > + struct vpu_device *vpu = dev_get_drvdata(dev);
> > > +
> > > + if (vpu->v4l2_m2m_dec_dev)
> > > + v4l2_m2m_suspend(vpu->v4l2_m2m_dec_dev);
> > > + if (vpu->v4l2_m2m_enc_dev)
> > > + v4l2_m2m_suspend(vpu->v4l2_m2m_enc_dev);
> > > +
> > > + return pm_runtime_force_suspend(dev); }
> > > +
> > > +static __maybe_unused int wave5_system_resume(struct device *dev) {
> > > + struct vpu_device *vpu = dev_get_drvdata(dev);
> > > + int ret;
> > > +
> > > + ret = pm_runtime_force_resume(dev);
> > > + if (ret < 0)
> > > + return ret;
> > > +
> > > + if (vpu->v4l2_m2m_dec_dev)
> > > + v4l2_m2m_resume(vpu->v4l2_m2m_dec_dev);
> > > + if (vpu->v4l2_m2m_enc_dev)
> > > + v4l2_m2m_resume(vpu->v4l2_m2m_enc_dev);
> >
> > Can you confirm that v4l2_m2m_dec_dev can be resumed before
> > v4l2_m2m_enc_dev? Usually you would suspend devices and resume them in
> > the opposite order so that you can preserve dependencies.
> Yes, both devices share the same IP and suspend/resume hooks, so the ordering
> should not matter.
Thanks for checking on this.
Reviewed-by: Kendall Willis <k-willis@ti.com>
>
> Thanks,
> Thorsten
> > Best,
> > Kendall
> >
> > > +
> > > + return 0;
> > > +}
> > > +
> > > static const struct dev_pm_ops wave5_pm_ops = {
> > > + SET_SYSTEM_SLEEP_PM_OPS(wave5_system_suspend,
> > wave5_system_resume)
> > > SET_RUNTIME_PM_OPS(wave5_pm_suspend, wave5_pm_resume,
> > NULL) };
> > >
> > > --
> > > 2.34.1
> > >
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-08 16:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 20:16 [PATCH] media: chips-media: wave5: Add system suspend/resume support Thorsten Lannynd
2026-07-08 15:23 ` Kendall Willis
2026-07-08 16:12 ` Lannynd, Thorsten
2026-07-08 16:22 ` Kendall Willis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox