diff options
author | Zhi Mao <zhi.mao@mediatek.com> | 2024-10-12 05:25:53 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2024-11-07 09:05:59 +0100 |
commit | a745d7acc1ebf97c0302e7a56665e28735943cf5 (patch) | |
tree | 879779fa3ca7acb39125bab6d443574caa05b470 /drivers/media/i2c | |
parent | media: i2c: ov5645: Switch to {enable,disable}_streams (diff) | |
download | linux-a745d7acc1ebf97c0302e7a56665e28735943cf5.tar.xz linux-a745d7acc1ebf97c0302e7a56665e28735943cf5.zip |
media: i2c: dw9768: Use runtime PM autosuspend
Use runtime PM autosuspend function to avoid rapid power state bouncing.
Signed-off-by: Zhi Mao <zhi.mao@mediatek.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/dw9768.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/dw9768.c b/drivers/media/i2c/dw9768.c index 87a7c3ceeb11..3a4d100b9199 100644 --- a/drivers/media/i2c/dw9768.c +++ b/drivers/media/i2c/dw9768.c @@ -374,7 +374,8 @@ static int dw9768_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) static int dw9768_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - pm_runtime_put(sd->dev); + pm_runtime_mark_last_busy(sd->dev); + pm_runtime_put_autosuspend(sd->dev); return 0; } @@ -490,6 +491,8 @@ static int dw9768_probe(struct i2c_client *client) goto err_power_off; } + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); pm_runtime_idle(dev); return 0; |