Commit 539a9859 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Tested-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 148709ad
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment