summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Stevenson <dave.stevenson@raspberrypi.com>2026-07-15 12:43:26 +0100
committerSakari Ailus <sakari.ailus@linux.intel.com>2026-07-15 17:04:31 +0300
commita21872acb74290a5dc62c7e50137012d08078b29 (patch)
treec72fbbcdf4b963fd4b1c5352745a50430972cbf2
parent8a52937caec744247fa31ea923d83c0b7fb7645d (diff)
media: imx355: Use pm_runtime autosuspend_delay
Avoid powering the sensor up and down unnecessarily by using pm_runtime's autosuspend_delay feature. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
-rw-r--r--drivers/media/i2c/imx355.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c
index 120eda46d982..17a2acc1152d 100644
--- a/drivers/media/i2c/imx355.c
+++ b/drivers/media/i2c/imx355.c
@@ -1074,7 +1074,7 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
goto err_rpm_put;
} else {
imx355_stop_streaming(imx355);
- pm_runtime_put(imx355->dev);
+ pm_runtime_put_autosuspend(imx355->dev);
}
/* vflip and hflip cannot change during streaming */
@@ -1086,7 +1086,7 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
return ret;
err_rpm_put:
- pm_runtime_put(imx355->dev);
+ pm_runtime_put_autosuspend(imx355->dev);
err_unlock:
mutex_unlock(&imx355->mutex);
@@ -1436,6 +1436,8 @@ static int imx355_probe(struct i2c_client *client)
*/
pm_runtime_set_active(imx355->dev);
pm_runtime_enable(imx355->dev);
+ pm_runtime_set_autosuspend_delay(imx355->dev, 1000);
+ pm_runtime_use_autosuspend(imx355->dev);
ret = v4l2_async_register_subdev_sensor(&imx355->sd);
if (ret < 0)
@@ -1448,6 +1450,7 @@ static int imx355_probe(struct i2c_client *client)
error_media_entity_runtime_pm:
pm_runtime_disable(imx355->dev);
pm_runtime_set_suspended(imx355->dev);
+ pm_runtime_dont_use_autosuspend(imx355->dev);
media_entity_cleanup(&imx355->sd.entity);
error_handler_free:
@@ -1478,6 +1481,8 @@ static void imx355_remove(struct i2c_client *client)
pm_runtime_set_suspended(imx355->dev);
}
+ pm_runtime_dont_use_autosuspend(imx355->dev);
+
mutex_destroy(&imx355->mutex);
}