From 5bd6b8c1bb2d49d5ff15c7c47d6b33d2d38785f0 Mon Sep 17 00:00:00 2001 From: Tarang Raval Date: Thu, 6 Mar 2025 11:04:44 +0530 Subject: [PATCH] media: i2c: imx219: media: i2c: imx219: Enable runtime PM autosuspend Use pm_runtime_put_autosuspend() instead of pm_runtime_put() to allow autosuspend. Set a 1000ms autosuspend delay in imx219_probe() to improve power efficiency. Signed-off-by: Tarang Raval Signed-off-by: Sakari Ailus Signed-off-by: Hans Verkuil --- drivers/media/i2c/imx219.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 1b4eb531b3155..3b4f685433422 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -771,7 +771,8 @@ static int imx219_enable_streams(struct v4l2_subdev *sd, return 0; err_rpm_put: - pm_runtime_put(&client->dev); + pm_runtime_mark_last_busy(&client->dev); + pm_runtime_put_autosuspend(&client->dev); return ret; } @@ -792,7 +793,8 @@ static int imx219_disable_streams(struct v4l2_subdev *sd, __v4l2_ctrl_grab(imx219->vflip, false); __v4l2_ctrl_grab(imx219->hflip, false); - pm_runtime_put(&client->dev); + pm_runtime_mark_last_busy(&client->dev); + pm_runtime_put_autosuspend(&client->dev); return ret; } @@ -1272,6 +1274,8 @@ static int imx219_probe(struct i2c_client *client) } pm_runtime_idle(dev); + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); return 0; -- 2.50.1