Skip to content

Commit 29bd527

Browse files
jailuthrapelwell
authored andcommitted
media: imx335: Update the native pixel array width
commit b82801a upstream. 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>
1 parent f8dcd0a commit 29bd527

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

drivers/media/i2c/imx335.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,20 @@
124124
#define IMX335_NUM_DATA_LANES 4
125125

126126
/* IMX335 native and active pixel array size. */
127-
#define IMX335_NATIVE_WIDTH 2616U
128-
#define IMX335_NATIVE_HEIGHT 1964U
129-
#define IMX335_PIXEL_ARRAY_LEFT 12U
130-
#define IMX335_PIXEL_ARRAY_TOP 12U
131-
#define IMX335_PIXEL_ARRAY_WIDTH 2592U
132-
#define IMX335_PIXEL_ARRAY_HEIGHT 1944U
127+
static const struct v4l2_rect imx335_native_area = {
128+
.top = 0,
129+
.left = 0,
130+
.width = 2696,
131+
.height = 2044,
132+
};
133+
134+
static const struct v4l2_rect imx335_active_area = {
135+
.top = 50,
136+
.left = 52,
137+
.width = 2592,
138+
.height = 1944,
139+
};
140+
133141

134142
/**
135143
* struct imx335_reg_list - imx335 sensor register list
@@ -869,21 +877,13 @@ static int imx335_get_selection(struct v4l2_subdev *sd,
869877
{
870878
switch (sel->target) {
871879
case V4L2_SEL_TGT_NATIVE_SIZE:
872-
sel->r.top = 0;
873-
sel->r.left = 0;
874-
sel->r.width = IMX335_NATIVE_WIDTH;
875-
sel->r.height = IMX335_NATIVE_HEIGHT;
876-
880+
sel->r = imx335_native_area;
877881
return 0;
878882

879883
case V4L2_SEL_TGT_CROP:
880884
case V4L2_SEL_TGT_CROP_DEFAULT:
881885
case V4L2_SEL_TGT_CROP_BOUNDS:
882-
sel->r.top = IMX335_PIXEL_ARRAY_TOP;
883-
sel->r.left = IMX335_PIXEL_ARRAY_LEFT;
884-
sel->r.width = IMX335_PIXEL_ARRAY_WIDTH;
885-
sel->r.height = IMX335_PIXEL_ARRAY_HEIGHT;
886-
886+
sel->r = imx335_active_area;
887887
return 0;
888888
}
889889

0 commit comments

Comments
 (0)