Re: [PATCH v3 16/17] media: i2c: os05b10: Enable runtime PM autosuspend
From: Jai Luthra
Date: Wed Jul 22 2026 - 02:08:46 EST
Hi Tarang,
Quoting Tarang Raval (2026-07-19 01:39:07)
> Use pm_runtime_put_autosuspend() instead of pm_runtime_put()
> to allow autosuspend. Set a 1000ms autosuspend delay.
>
> Signed-off-by: Tarang Raval <tarang.raval@xxxxxxxxxxxxxxxxx>
> ---
> drivers/media/i2c/os05b10.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/os05b10.c b/drivers/media/i2c/os05b10.c
> index 59097eb96561..b4dd3137ad5c 100644
> --- a/drivers/media/i2c/os05b10.c
> +++ b/drivers/media/i2c/os05b10.c
> @@ -1057,7 +1057,7 @@ static int os05b10_enable_streams(struct v4l2_subdev *sd,
> return 0;
>
> err_rpm_put:
> - pm_runtime_put(os05b10->dev);
> + pm_runtime_put_autosuspend(os05b10->dev);
>
> return ret;
> }
> @@ -1077,7 +1077,7 @@ static int os05b10_disable_streams(struct v4l2_subdev *sd,
> __v4l2_ctrl_grab(os05b10->vflip, false);
> __v4l2_ctrl_grab(os05b10->hflip, false);
>
> - pm_runtime_put(os05b10->dev);
> + pm_runtime_put_autosuspend(os05b10->dev);
>
> return 0;
> }
> @@ -1455,6 +1455,8 @@ static int os05b10_probe(struct i2c_client *client)
>
> pm_runtime_set_active(os05b10->dev);
> pm_runtime_enable(os05b10->dev);
> + pm_runtime_set_autosuspend_delay(os05b10->dev, 1000);
> + pm_runtime_use_autosuspend(os05b10->dev);
These two calls are easier to understand (for both humans and sashiko)
moved to the end of the probe, when you're done configuring the sensor and
call pm_runtime_idle().
Thanks,
Jai
>
> ret = v4l2_async_register_subdev_sensor(&os05b10->sd);
> if (ret < 0) {
> --
> 2.34.1
>
>