Skip to content

Commit 146a671

Browse files
committed
media: imx355: Define the exposure offset, and use that define
The difference between frame length and max exposure time in lines is 10. That had been used as a bare value in calculations. Move it to a define, and use that define. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 3ea9642 commit 146a671

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/media/i2c/imx355.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#define IMX355_EXPOSURE_MIN 1
5656
#define IMX355_EXPOSURE_STEP 1
5757
#define IMX355_EXPOSURE_DEFAULT 0x0282
58+
#define IMX355_EXPOSURE_OFFSET 10
5859

5960
/* Analog gain control */
6061
#define IMX355_REG_ANALOG_GAIN CCI_REG16(0x0204)
@@ -615,7 +616,7 @@ static int imx355_set_ctrl(struct v4l2_ctrl *ctrl)
615616
switch (ctrl->id) {
616617
case V4L2_CID_VBLANK:
617618
/* Update max exposure while meeting expected vblanking */
618-
max = format->height + ctrl->val - 10;
619+
max = format->height + ctrl->val - IMX355_EXPOSURE_OFFSET;
619620
__v4l2_ctrl_modify_range(imx355->exposure,
620621
imx355->exposure->minimum,
621622
max, imx355->exposure->step, max);
@@ -1077,7 +1078,7 @@ static int imx355_init_controls(struct imx355 *imx355)
10771078
imx355->hblank->flags |= V4L2_CTRL_FLAG_READ_ONLY;
10781079

10791080
/* fll >= exposure time + adjust parameter (default value is 10) */
1080-
exposure_max = mode->fll_def - 10;
1081+
exposure_max = mode->fll_def - IMX355_EXPOSURE_OFFSET;
10811082
imx355->exposure = v4l2_ctrl_new_std(ctrl_hdlr, &imx355_ctrl_ops,
10821083
V4L2_CID_EXPOSURE,
10831084
IMX355_EXPOSURE_MIN, exposure_max,

0 commit comments

Comments
 (0)