summaryrefslogtreecommitdiff
path: root/drivers/staging/media/imx/imx7-media-csi.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-10 03:06:45 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-08 18:03:00 +0100
commit0eaa3d82d47021f9c634700c74bb2cadc43767bf (patch)
treef657fa096445828bcb53d610872588fad1e052a5 /drivers/staging/media/imx/imx7-media-csi.c
parent1de014dc6bf91155d292c2a03905b9b1ebe1f67d (diff)
media: staging: media: imx: imx7-media-csi: Make default formats consistent
Use the same default image width and height for both the CSI subdev and the video node to achieve a consistent default through the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/imx/imx7-media-csi.c')
-rw-r--r--drivers/staging/media/imx/imx7-media-csi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
index 98cf1cf41fda..b76e040e45da 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -165,10 +165,11 @@
#define IMX7_CSI_VIDEO_NAME "imx-capture"
/* In bytes, per queue */
#define IMX7_CSI_VIDEO_MEM_LIMIT SZ_64M
-#define IMX7_CSI_VIDEO_DEF_PIX_WIDTH 640
-#define IMX7_CSI_VIDEO_DEF_PIX_HEIGHT 480
#define IMX7_CSI_VIDEO_EOF_TIMEOUT 2000
+#define IMX7_CSI_DEF_PIX_WIDTH 640
+#define IMX7_CSI_DEF_PIX_HEIGHT 480
+
enum imx_csi_model {
IMX7_CSI_IMX7 = 0,
IMX7_CSI_IMX8MQ,
@@ -303,7 +304,8 @@ static void imx7_csi_init_default(struct imx7_csi *csi)
imx7_csi_reg_write(csi, 0, CSI_CSICR2);
imx7_csi_reg_write(csi, BIT_FRMCNT_RST, CSI_CSICR3);
- imx7_csi_reg_write(csi, BIT_IMAGE_WIDTH(800) | BIT_IMAGE_HEIGHT(600),
+ imx7_csi_reg_write(csi, BIT_IMAGE_WIDTH(IMX7_CSI_DEF_PIX_WIDTH) |
+ BIT_IMAGE_HEIGHT(IMX7_CSI_DEF_PIX_HEIGHT),
CSI_CSIIMAG_PARA);
imx7_csi_reg_write(csi, BIT_DMA_REFLASH_RFF, CSI_CSICR3);
@@ -1628,8 +1630,8 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi)
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
};
fmt_src.format.code = MEDIA_BUS_FMT_UYVY8_2X8;
- fmt_src.format.width = IMX7_CSI_VIDEO_DEF_PIX_WIDTH;
- fmt_src.format.height = IMX7_CSI_VIDEO_DEF_PIX_HEIGHT;
+ fmt_src.format.width = IMX7_CSI_DEF_PIX_WIDTH;
+ fmt_src.format.height = IMX7_CSI_DEF_PIX_HEIGHT;
imx7_csi_mbus_fmt_to_pix_fmt(&csi->vdev_fmt, &fmt_src.format, NULL);
csi->vdev_compose.width = fmt_src.format.width;
@@ -1818,8 +1820,9 @@ static int imx7_csi_init_cfg(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mf =
imx7_csi_get_format(csi, sd_state, i, which);
- ret = imx7_csi_init_mbus_fmt(mf, 800, 600, 0, V4L2_FIELD_NONE,
- &csi->cc[i]);
+ ret = imx7_csi_init_mbus_fmt(mf, IMX7_CSI_DEF_PIX_WIDTH,
+ IMX7_CSI_DEF_PIX_HEIGHT, 0,
+ V4L2_FIELD_NONE, &csi->cc[i]);
if (ret < 0)
return ret;
}