Skip to content

Commit bd50eff

Browse files
Rahi374kbingham
authored andcommitted
media: imx335: Set vblank immediately
When the vblank v4l2 control is set, it does not get written to the hardware immediately. It only gets updated when exposure is set. Change the behavior such that the vblank is written immediately when the control is set. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
1 parent 19af40e commit bd50eff

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

drivers/media/i2c/imx335.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,12 @@ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl)
615615
imx335->vblank,
616616
imx335->vblank + imx335->cur_mode->height);
617617

618-
return __v4l2_ctrl_modify_range(imx335->exp_ctrl,
619-
IMX335_EXPOSURE_MIN,
620-
imx335->vblank +
621-
imx335->cur_mode->height -
622-
IMX335_EXPOSURE_OFFSET,
623-
1, IMX335_EXPOSURE_DEFAULT);
618+
__v4l2_ctrl_modify_range(imx335->exp_ctrl,
619+
IMX335_EXPOSURE_MIN,
620+
imx335->vblank +
621+
imx335->cur_mode->height -
622+
IMX335_EXPOSURE_OFFSET,
623+
1, IMX335_EXPOSURE_DEFAULT);
624624
}
625625

626626
/*
@@ -631,6 +631,13 @@ static int imx335_set_ctrl(struct v4l2_ctrl *ctrl)
631631
return 0;
632632

633633
switch (ctrl->id) {
634+
case V4L2_CID_VBLANK:
635+
exposure = imx335->exp_ctrl->val;
636+
analog_gain = imx335->again_ctrl->val;
637+
638+
ret = imx335_update_exp_gain(imx335, exposure, analog_gain);
639+
640+
break;
634641
case V4L2_CID_EXPOSURE:
635642
exposure = ctrl->val;
636643
analog_gain = imx335->again_ctrl->val;

0 commit comments

Comments
 (0)