[PATCH v2 22/25] media: i2c: imx283: Recalculate SHR on blanking changes
From: Kieran Bingham
Date: Fri Feb 13 2026 - 09:08:52 EST
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 <kieran.bingham@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/imx283.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c
index 75a35d9db05d..7fb654512c20 100644
--- a/drivers/media/i2c/imx283.c
+++ b/drivers/media/i2c/imx283.c
@@ -909,6 +909,11 @@ static int imx283_set_ctrl(struct v4l2_ctrl *ctrl)
dev_dbg(imx283->dev, "V4L2_CID_HBLANK : %d HMAX : %u\n",
ctrl->val, imx283->hmax);
ret = cci_write(imx283->cci, IMX283_REG_HMAX, imx283->hmax, NULL);
+
+ /* Recompute the SHR based on the new timings */
+ shr = imx283_shr(imx283, mode, imx283->exposure->val);
+ cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
+
break;
case V4L2_CID_VBLANK:
@@ -916,6 +921,11 @@ static int imx283_set_ctrl(struct v4l2_ctrl *ctrl)
dev_dbg(imx283->dev, "V4L2_CID_VBLANK : %d VMAX : %u\n",
ctrl->val, imx283->vmax);
ret = cci_write(imx283->cci, IMX283_REG_VMAX, imx283->vmax, NULL);
+
+ /* Recompute the SHR based on the new timings */
+ shr = imx283_shr(imx283, mode, imx283->exposure->val);
+ cci_write(imx283->cci, IMX283_REG_SHR, shr, &ret);
+
break;
case V4L2_CID_ANALOGUE_GAIN:
--
2.52.0