Commit 58d0a3db authored by Hugues Fruchet's avatar Hugues Fruchet Committed by Greg Kroah-Hartman

media: ov5640: fix framerate update

[ Upstream commit 0929983e ]

Changing framerate right before streamon had no effect,
the new framerate value was taken into account only at
next streamon, fix this.
Signed-off-by: default avatarHugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 47dd538e
...@@ -2572,8 +2572,6 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, ...@@ -2572,8 +2572,6 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
if (frame_rate < 0) if (frame_rate < 0)
frame_rate = OV5640_15_FPS; frame_rate = OV5640_15_FPS;
sensor->current_fr = frame_rate;
sensor->frame_interval = fi->interval;
mode = ov5640_find_mode(sensor, frame_rate, mode->hact, mode = ov5640_find_mode(sensor, frame_rate, mode->hact,
mode->vact, true); mode->vact, true);
if (!mode) { if (!mode) {
...@@ -2581,7 +2579,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd, ...@@ -2581,7 +2579,10 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
goto out; goto out;
} }
if (mode != sensor->current_mode) { if (mode != sensor->current_mode ||
frame_rate != sensor->current_fr) {
sensor->current_fr = frame_rate;
sensor->frame_interval = fi->interval;
sensor->current_mode = mode; sensor->current_mode = mode;
sensor->pending_mode_change = true; sensor->pending_mode_change = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment