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:02 +0100 |
commit | 539a9859768dffec27623644268c232895bc7bc0 (patch) | |
tree | de6c629b35cf0aaf0cfb2189272a8f8bccf0a782 /drivers/staging/media/imx | |
parent | 148709ad22cb5d2745ef075948ba2411645a590f (diff) | |
download | linux-stable-539a9859768dffec27623644268c232895bc7bc0.tar.gz linux-stable-539a9859768dffec27623644268c232895bc7bc0.tar.bz2 linux-stable-539a9859768dffec27623644268c232895bc7bc0.zip |
media: staging: media: imx: imx7-media-csi: Simplify default mbus code in try_fmt
When trying a format on the subdev sink pad, if the requested media bus
code isn't supported, fallback to the default with a simpler logic.
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 | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index f8c21dd00e55..0b9efce8649c 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1973,11 +1973,10 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi, *cc = imx7_csi_find_mbus_format(sdformat->format.code, IMX7_CSI_PIXFMT_SEL_ANY); if (!*cc) { - imx7_csi_enum_mbus_formats(&code, 0, - IMX7_CSI_PIXFMT_SEL_YUV_RGB); + code = IMX7_CSI_DEF_MBUS_CODE; *cc = imx7_csi_find_mbus_format(code, - IMX7_CSI_PIXFMT_SEL_YUV_RGB); - sdformat->format.code = (*cc)->codes[0]; + IMX7_CSI_PIXFMT_SEL_ANY); + sdformat->format.code = code; } if (sdformat->format.field != V4L2_FIELD_INTERLACED) |