media: ov5675: correct the maximum exposure value
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.
Signed-off-by Bingbu Cao <[email protected]>
--- drivers/media/i2c/ov5675.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5675.c +2 -2
@@ -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
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.
Signed-off-by Bingbu Cao <[email protected]>--- drivers/media/i2c/ov5675.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/i2c/ov5675.c +2
-2@@ -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