]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: imx335: Update HBLANK range on mode change
authorJai Luthra <jai.luthra@ideasonboard.com>
Thu, 30 Oct 2025 08:42:57 +0000 (14:12 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 13 Nov 2025 09:57:52 +0000 (10:57 +0100)
While switching modes, updating to a different value of HBLANK isn't
sufficient, as this is a read-only control with a single allowed value,
and thus hblank_min == hblank_max == hblank of the default mode.

So to correctly update the user-facing value of the HBLANK parameter,
which is necessary for correct framerate calculation, update the whole
range when switching modes.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/imx335.c

index d30fce32cb010799f71de1d313480b8efa1c7c0f..b03e3e14d0880f16458c92048bd7ce6377e76586 100644 (file)
@@ -493,7 +493,8 @@ static int imx335_update_controls(struct imx335 *imx335,
        if (ret)
                return ret;
 
-       ret = __v4l2_ctrl_s_ctrl(imx335->hblank_ctrl, mode->hblank);
+       ret = __v4l2_ctrl_modify_range(imx335->hblank_ctrl, mode->hblank,
+                                      mode->hblank, 1, mode->hblank);
        if (ret)
                return ret;