[PATCH v2 10/25] media: i2c: imx283: Move Horizontal configuration block
From: Kieran Bingham
Date: Fri Feb 13 2026 - 09:08:09 EST
Adapt the Horiztonal configuration into its own scope to improve
readability of these two associated register configurations.
No functional change intended in this commit.
Signed-off-by: Kieran Bingham <kieran.bingham@xxxxxxxxxxxxxxxx>
---
drivers/media/i2c/imx283.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c
index 32b8070756f0..6d551a26cfa6 100644
--- a/drivers/media/i2c/imx283.c
+++ b/drivers/media/i2c/imx283.c
@@ -1160,10 +1160,19 @@ static int imx283_start_streaming(struct imx283 *imx283,
cci_write(imx283->cci, IMX283_REG_OB_SIZE_V, mode->scan->vertical_ob, &ret);
- /* TODO: Validate mode->crop is fully contained within imx283_native_area */
- cci_write(imx283->cci, IMX283_REG_HTRIMMING_START, mode->crop.left, &ret);
- cci_write(imx283->cci, IMX283_REG_HTRIMMING_END,
- mode->crop.left + mode->crop.width, &ret);
+ /* Horizontal Configuration */
+ {
+ /*
+ * While Vertical OB is excluded from the sensor positions,
+ * the Horizontal OB is included within the whole HTRIMMING
+ * calculation.
+ */
+ u32 left = mode->crop.left;
+ u32 right = left + mode->crop.width;
+
+ cci_write(imx283->cci, IMX283_REG_HTRIMMING_START, left, &ret);
+ cci_write(imx283->cci, IMX283_REG_HTRIMMING_END, right, &ret);
+ }
/* Disable embedded data */
cci_write(imx283->cci, IMX283_REG_EBD_X_OUT_SIZE, 0, &ret);
--
2.52.0