Skip to content

Commit 55f551a

Browse files
committed
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>
1 parent 6c8e8db commit 55f551a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/media/i2c/imx355.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
11291129
goto err_rpm_put;
11301130
} else {
11311131
imx355_stop_streaming(imx355);
1132-
pm_runtime_put(imx355->dev);
1132+
pm_runtime_put_autosuspend(imx355->dev);
11331133
}
11341134

11351135
/* vflip and hflip cannot change during streaming */
@@ -1141,7 +1141,7 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable)
11411141
return ret;
11421142

11431143
err_rpm_put:
1144-
pm_runtime_put(imx355->dev);
1144+
pm_runtime_put_autosuspend(imx355->dev);
11451145
err_unlock:
11461146
mutex_unlock(&imx355->mutex);
11471147

@@ -1499,6 +1499,8 @@ static int imx355_probe(struct i2c_client *client)
14991499
pm_runtime_set_active(imx355->dev);
15001500
pm_runtime_enable(imx355->dev);
15011501
pm_runtime_idle(imx355->dev);
1502+
pm_runtime_set_autosuspend_delay(imx355->dev, 1000);
1503+
pm_runtime_use_autosuspend(imx355->dev);
15021504

15031505
ret = v4l2_async_register_subdev_sensor(&imx355->sd);
15041506
if (ret < 0)

0 commit comments

Comments
 (0)