diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-05-10 03:06:45 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-08 18:03:01 +0100 |
commit | 148709ad22cb5d2745ef075948ba2411645a590f (patch) | |
tree | ed3a6c13780db325a696b801089e9371401999d0 /drivers/staging/media/imx | |
parent | 0eaa3d82d47021f9c634700c74bb2cadc43767bf (diff) | |
download | linux-stable-148709ad22cb5d2745ef075948ba2411645a590f.tar.gz linux-stable-148709ad22cb5d2745ef075948ba2411645a590f.tar.bz2 linux-stable-148709ad22cb5d2745ef075948ba2411645a590f.zip |
media: staging: media: imx: imx7-media-csi: Define macro for default mbus code
Define a macro for the default media bus code and use it through the
driver to replace a hardcoded value and a dynamic query from the
pixel_formats table.
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')
-rw-r--r-- | drivers/staging/media/imx/imx7-media-csi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index b76e040e45da..f8c21dd00e55 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -167,6 +167,7 @@ #define IMX7_CSI_VIDEO_MEM_LIMIT SZ_64M #define IMX7_CSI_VIDEO_EOF_TIMEOUT 2000 +#define IMX7_CSI_DEF_MBUS_CODE MEDIA_BUS_FMT_UYVY8_2X8 #define IMX7_CSI_DEF_PIX_WIDTH 640 #define IMX7_CSI_DEF_PIX_HEIGHT 480 @@ -820,7 +821,8 @@ enum imx7_csi_pixfmt_sel { }; /* - * List of supported pixel formats for the subdevs. + * List of supported pixel formats for the subdevs. Keep MEDIA_BUS_FMT_UYVY8_2X8 + * first to match IMX7_CSI_DEF_MBUS_CODE. */ static const struct imx7_csi_pixfmt pixel_formats[] = { /*** YUV formats start here ***/ @@ -1096,7 +1098,7 @@ static int imx7_csi_init_mbus_fmt(struct v4l2_mbus_framefmt *mbus, mbus->field = field; if (code == 0) - imx7_csi_enum_mbus_formats(&code, 0, IMX7_CSI_PIXFMT_SEL_YUV); + code = IMX7_CSI_DEF_MBUS_CODE; lcc = imx7_csi_find_mbus_format(code, IMX7_CSI_PIXFMT_SEL_ANY); if (!lcc) @@ -1629,7 +1631,7 @@ static int imx7_csi_video_init_format(struct imx7_csi *csi) .pad = IMX7_CSI_PAD_SRC, .which = V4L2_SUBDEV_FORMAT_ACTIVE, }; - fmt_src.format.code = MEDIA_BUS_FMT_UYVY8_2X8; + fmt_src.format.code = IMX7_CSI_DEF_MBUS_CODE; fmt_src.format.width = IMX7_CSI_DEF_PIX_WIDTH; fmt_src.format.height = IMX7_CSI_DEF_PIX_HEIGHT; |