Skip to contentSkip to conversation

media: ov5675: correct the maximum exposure value

PATCH Superseded Bingbu Cao 2 participants 2 messages Aug 20, 2020 – Aug 21, 2020

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Bingbu Cao

author
#0 lore raw

PATCH 1/1 media: ov5675: correct the maximum exposure value

current ov5675 driver did a wrong calculation for the maximum exposure value, it will cause the auto-exposure can not work as expected, this patch correct it.

---
 drivers/media/i2c/ov5675.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5675.c +2 -2
index 8537cc4ca108..7592cd50807a 100644
@@ -666,8 +666,8 @@ static int ov5675_set_ctrl(struct v4l2_ctrl *ctrl)
 	/* Propagate change of current control to all related controls */
 	if (ctrl->id == V4L2_CID_VBLANK) {
 		/* Update max exposure while meeting expected vblanking */
-		exposure_max = (ov5675->cur_mode->height + ctrl->val -
-			       OV5675_EXPOSURE_MAX_MARGIN) / 2;
+		exposure_max = ov5675->cur_mode->height + ctrl->val -
+			OV5675_EXPOSURE_MAX_MARGIN;
 		__v4l2_ctrl_modify_range(ov5675->exposure,
 					 ov5675->exposure->minimum,
 					 exposure_max, ov5675->exposure->step,
Signature · 1 line
2.7.4
#1 lore raw

Got some information from Shawn, that the code before was align with the spec.

Sakari, please ignore this patch and I will try to figure out the actual reason of the auto-exposure issue.

Thanks.

Quoted 25 lines · Bingbu Cao

current ov5675 driver did a wrong calculation for the maximum exposure value, it will cause the auto-exposure can not work as expected, this patch correct it.

---
 drivers/media/i2c/ov5675.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5675.c +2 -2
index 8537cc4ca108..7592cd50807a 100644
@@ -666,8 +666,8 @@ static int ov5675_set_ctrl(struct v4l2_ctrl *ctrl)
 	/* Propagate change of current control to all related controls */
 	if (ctrl->id == V4L2_CID_VBLANK) {
 		/* Update max exposure while meeting expected vblanking */
-		exposure_max = (ov5675->cur_mode->height + ctrl->val -
-			       OV5675_EXPOSURE_MAX_MARGIN) / 2;
+		exposure_max = ov5675->cur_mode->height + ctrl->val -
+			OV5675_EXPOSURE_MAX_MARGIN;
 		__v4l2_ctrl_modify_range(ov5675->exposure,
 					 ov5675->exposure->minimum,
 					 exposure_max, ov5675->exposure->step,
Signature · 2 lines
Best regards,
Bingbu Cao