Skip to content

Commit 5f68734

Browse files
committed
media: i2c: imx283: Recalculate SHR on blanking changes
The exposure control on the imx283 is handled through the SHR register. This value is calculated based upon the hmax and vmax registers as a property of the total line and frame length. Ensure that the SHR is updated whenever the blankings update and adjust the frame intervals to ensure the correct exposure is configured on the sensor. Signed-off-by: Kieran Bingham <[email protected]>
1 parent 0a93b53 commit 5f68734

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/media/i2c/imx283.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,23 @@ static int imx283_set_ctrl(struct v4l2_ctrl *ctrl)
909909
dev_dbg(imx283->dev, "V4L2_CID_HBLANK : %d HMAX : %u\n",
910910
ctrl->val, imx283->hmax);
911911
ret = cci_write(imx283->cci, IMX283_REG_HMAX, imx283->hmax, NULL);
912+
913+
/* Recompute the SHR based on the new timings */
914+
shr = imx283_shr(imx283, mode, imx283->exposure->val);
915+
cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
916+
912917
break;
913918

914919
case V4L2_CID_VBLANK:
915920
imx283->vmax = mode->height + ctrl->val;
916921
dev_dbg(imx283->dev, "V4L2_CID_VBLANK : %d VMAX : %u\n",
917922
ctrl->val, imx283->vmax);
918923
ret = cci_write(imx283->cci, IMX283_REG_VMAX, imx283->vmax, NULL);
924+
925+
/* Recompute the SHR based on the new timings */
926+
shr = imx283_shr(imx283, mode, imx283->exposure->val);
927+
cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
928+
919929
break;
920930

921931
case V4L2_CID_ANALOGUE_GAIN:

0 commit comments

Comments
 (0)