[PATCH 40/50] staging: media: imx: imx7-media-csi: Simplify default mbus code in try_fmt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx>
---
 drivers/staging/media/imx/imx7-media-csi.c | 7 +++----
 1 file 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 f2e85e9851e4..f3b9ce03318f 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -1972,11 +1972,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)
-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux