]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: imx335: Update the native pixel array width
authorJai Luthra <jai.luthra@ideasonboard.com>
Thu, 30 Oct 2025 08:42:56 +0000 (14:12 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 13 Nov 2025 09:57:52 +0000 (10:57 +0100)
The sensor datasheet reports actual total number of pixels as 2696x2044.

This becomes important for supporting 2x2 binning modes that can go
beyond the current maximum pixel array width set here.

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 797821db86a41caa2d654f1034016f0fe51b95e3..d30fce32cb010799f71de1d313480b8efa1c7c0f 100644 (file)
 #define IMX335_NUM_DATA_LANES  4
 
 /* IMX335 native and active pixel array size. */
-#define IMX335_NATIVE_WIDTH            2616U
-#define IMX335_NATIVE_HEIGHT           1964U
-#define IMX335_PIXEL_ARRAY_LEFT                12U
-#define IMX335_PIXEL_ARRAY_TOP         12U
-#define IMX335_PIXEL_ARRAY_WIDTH       2592U
-#define IMX335_PIXEL_ARRAY_HEIGHT      1944U
+static const struct v4l2_rect imx335_native_area = {
+       .top = 0,
+       .left = 0,
+       .width = 2696,
+       .height = 2044,
+};
+
+static const struct v4l2_rect imx335_active_area = {
+       .top = 50,
+       .left = 52,
+       .width = 2592,
+       .height = 1944,
+};
+
 
 /**
  * struct imx335_reg_list - imx335 sensor register list
@@ -862,21 +870,13 @@ static int imx335_get_selection(struct v4l2_subdev *sd,
 {
        switch (sel->target) {
        case V4L2_SEL_TGT_NATIVE_SIZE:
-               sel->r.top = 0;
-               sel->r.left = 0;
-               sel->r.width = IMX335_NATIVE_WIDTH;
-               sel->r.height = IMX335_NATIVE_HEIGHT;
-
+               sel->r = imx335_native_area;
                return 0;
 
        case V4L2_SEL_TGT_CROP:
        case V4L2_SEL_TGT_CROP_DEFAULT:
        case V4L2_SEL_TGT_CROP_BOUNDS:
-               sel->r.top = IMX335_PIXEL_ARRAY_TOP;
-               sel->r.left = IMX335_PIXEL_ARRAY_LEFT;
-               sel->r.width = IMX335_PIXEL_ARRAY_WIDTH;
-               sel->r.height = IMX335_PIXEL_ARRAY_HEIGHT;
-
+               sel->r = imx335_active_area;
                return 0;
        }