Commit e13064a3 authored by Andrey Skvortsov's avatar Andrey Skvortsov Committed by Mauro Carvalho Chehab
Browse files

media: ov5640: Update last busy timestamp to reset autosuspend timer



Otherwise autosuspend delay doesn't work and power is cut off
immediately as device is freed.

Signed-off-by: default avatarAndrey Skvortsov <andrej.skvortzov@gmail.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent e14d3ac8
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -3327,6 +3327,7 @@ static int ov5640_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
		break;
		break;
	}
	}


	pm_runtime_mark_last_busy(&sensor->i2c_client->dev);
	pm_runtime_put_autosuspend(&sensor->i2c_client->dev);
	pm_runtime_put_autosuspend(&sensor->i2c_client->dev);


	return 0;
	return 0;
@@ -3402,6 +3403,7 @@ static int ov5640_s_ctrl(struct v4l2_ctrl *ctrl)
		break;
		break;
	}
	}


	pm_runtime_mark_last_busy(&sensor->i2c_client->dev);
	pm_runtime_put_autosuspend(&sensor->i2c_client->dev);
	pm_runtime_put_autosuspend(&sensor->i2c_client->dev);


	return ret;
	return ret;
@@ -3721,8 +3723,10 @@ static int ov5640_s_stream(struct v4l2_subdev *sd, int enable)
out:
out:
	mutex_unlock(&sensor->lock);
	mutex_unlock(&sensor->lock);


	if (!enable || ret)
	if (!enable || ret) {
		pm_runtime_mark_last_busy(&sensor->i2c_client->dev);
		pm_runtime_put_autosuspend(&sensor->i2c_client->dev);
		pm_runtime_put_autosuspend(&sensor->i2c_client->dev);
	}


	return ret;
	return ret;
}
}
@@ -3927,6 +3931,7 @@ static int ov5640_probe(struct i2c_client *client)


	pm_runtime_set_autosuspend_delay(dev, 1000);
	pm_runtime_set_autosuspend_delay(dev, 1000);
	pm_runtime_use_autosuspend(dev);
	pm_runtime_use_autosuspend(dev);
	pm_runtime_mark_last_busy(dev);
	pm_runtime_put_autosuspend(dev);
	pm_runtime_put_autosuspend(dev);


	return 0;
	return 0;