Skip to content

Commit 0a6eff7

Browse files
davidplowmanpelwell
authored andcommitted
media: i2c: imx290: Handle exposure correctly when vblank changes
When vblank changes we must modify the exposure range. Also, with this sensor, the effective exposure time implicitly changes when vblank does, so we have to reset it after every vblank update. Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
1 parent 8c7faec commit 0a6eff7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎drivers/media/i2c/imx290.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,24 @@ static int imx290_set_vmax(struct imx290 *imx290, u32 val)
618618
if (ret)
619619
dev_err(imx290->dev, "Unable to write vmax\n");
620620

621+
/*
622+
* Changing vblank changes the allowed range for exposure.
623+
* We don't supply the current exposure as default here as it
624+
* may lie outside the new range. We will reset it just below.
625+
*/
626+
__v4l2_ctrl_modify_range(imx290->exposure,
627+
IMX290_EXPOSURE_MIN,
628+
vmax - 2,
629+
IMX290_EXPOSURE_STEP,
630+
vmax - 2);
631+
632+
/*
633+
* Becuse of the way exposure works for this sensor, updating
634+
* vblank causes the effective exposure to change, so we must
635+
* set it back to the "new" correct value.
636+
*/
637+
imx290_set_exposure(imx290, imx290->exposure->val);
638+
621639
return ret;
622640
}
623641

0 commit comments

Comments
 (0)