media: i2c: imx335: Fix hblank min/max values
authorKieran Bingham <kieran.bingham@ideasonboard.com>
Mon, 11 Dec 2023 12:59:48 +0000 (18:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:28 +0000 (20:14 +0000)
[ Upstream commit d7b95ad7a8d56248dfc34f861e445fad7a4004f4 ]

The V4L2_CID_HBLANK control is marked as readonly and can only be a
single value.

Set the minimum and maximum value to match the mode value.

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/imx335.c

index 482a0b7..26869ab 100644 (file)
@@ -971,8 +971,8 @@ static int imx335_init_controls(struct imx335 *imx335)
        imx335->hblank_ctrl = v4l2_ctrl_new_std(ctrl_hdlr,
                                                &imx335_ctrl_ops,
                                                V4L2_CID_HBLANK,
-                                               IMX335_REG_MIN,
-                                               IMX335_REG_MAX,
+                                               mode->hblank,
+                                               mode->hblank,
                                                1, mode->hblank);
        if (imx335->hblank_ctrl)
                imx335->hblank_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;