[PATCH v4 12/12] ov5640: Enforce a mode change when changing the framerate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The current logic only requires to call ov5640_set_mode, which will in turn
change the clock rates according to the mode and frame interval, when a new
mode is set up.

However, when only the frame interval is changed but the mode isn't,
ov5640_set_mode is never called and the resulting frame rate will be old or
default one. Fix this by requiring that ov5640_set_mode is called when the
frame interval is changed as well.

Signed-off-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxx>
---
 drivers/media/i2c/ov5640.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 818411400ef6..e01d2cb93c67 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -2638,8 +2638,12 @@ static int ov5640_s_frame_interval(struct v4l2_subdev *sd,
 		goto out;
 	}
 
-	sensor->current_fr = frame_rate;
-	sensor->frame_interval = fi->interval;
+	if (frame_rate != sensor->current_fr) {
+		sensor->current_fr = frame_rate;
+		sensor->frame_interval = fi->interval;
+		sensor->pending_mode_change = true;
+	}
+
 	mode = ov5640_find_mode(sensor, frame_rate, mode->hact,
 				mode->vact, true);
 	if (!mode) {
-- 
2.19.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux