[PATCH 06/10] media: i2c: ov9282: refresh flash_duration range on an HBLANK write

From: Richard Leitner

Date: Mon Sep 14 2026 - 15:30:45 EST


The strobe ceiling is the exposure time in microseconds, so it follows
the line time, and the line length sets the line time. Writing HBLANK moves
it and nothing recomputes the flash_duration ceiling.

Therefore add the missing flash_duration range update when HBLANK is set.

The exposure range is counted in lines, so it is unaffected and does not
need refreshing here.

Signed-off-by: Richard Leitner <richard.leitner@xxxxxxxxx>
---
drivers/media/i2c/ov9282.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c
index e64d8343c18e9..632184e76b9bd 100644
--- a/drivers/media/i2c/ov9282.c
+++ b/drivers/media/i2c/ov9282.c
@@ -674,6 +674,19 @@ static int ov9282_set_ctrl(struct v4l2_ctrl *ctrl)
if (ret)
return ret;
break;
+ case V4L2_CID_HBLANK:
+ /*
+ * HBLANK affects the line time, which then affects the flash
+ * duration. Therefore recalculate the flash duration range
+ * here.
+ */
+ exposure = ov9282_exposure_to_us(ov9282, ov9282->exp_ctrl->val);
+ ret = __v4l2_ctrl_modify_range(ov9282->flash_duration, 0,
+ exposure, 1,
+ OV9282_STROBE_FRAME_SPAN_DEFAULT);
+ if (ret)
+ return ret;
+ break;
}

/* Set controls only if sensor is in power on state */

--
2.53.0