]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: imx335: Fix frame size enumeration
authorKieran Bingham <kieran.bingham@ideasonboard.com>
Wed, 30 Apr 2025 07:36:49 +0000 (08:36 +0100)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 6 May 2025 11:06:30 +0000 (13:06 +0200)
In commit cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit
mode") the IMX335 driver was extended to support multiple output
bitdepth modes.

This incorrectly extended the frame size enumeration to check against
the supported mbus_codes array instead of the supported mode/frame
array. This has the unwanted side effect of reporting the currently
supported frame size 2592x1944 three times.

Fix the check accordingly to report a frame size for each supported
size, which is presently only a single entry.

Fixes: cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit mode")
Cc: stable@vger.kernel.org
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@xs4all.nl>
drivers/media/i2c/imx335.c

index d400a019f6b3f4555cdc721480b7985e5613cb5c..9b4db4cd4929caf83596e93d2ac3de2f54e892b0 100644 (file)
@@ -660,7 +660,8 @@ static int imx335_enum_frame_size(struct v4l2_subdev *sd,
        struct imx335 *imx335 = to_imx335(sd);
        u32 code;
 
-       if (fsize->index > ARRAY_SIZE(imx335_mbus_codes))
+       /* Only a single supported_mode available. */
+       if (fsize->index > 0)
                return -EINVAL;
 
        code = imx335_get_format_code(imx335, fsize->code);