Re: [PATCH 06/10] media: i2c: ov9282: refresh flash_duration range on an HBLANK write
From: Dave Stevenson
Date: Wed Sep 23 2026 - 12:24:38 EST
Hi Richard
On Mon, 14 Sept 2026 at 20:21, Richard Leitner
<richard.leitner@xxxxxxxxx> wrote:
>
> 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.
> + */
Except for the comment, this clause is identical to that for
V4L2_CID_EXPOSURE that you added in patch 4. No need for the
duplication.
Dave
> + 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
>
>