[PATCH 5/7] media: sun6i: Support the YUYV format properly

Maxime Ripard maxime.ripard at bootlin.com
Mon Mar 5 01:35:32 PST 2018


Currently, if we ever start a capture using the YUYV format, the switch
case in the get_csi_input_seq function will not catch it since it considers
it the default case.

However, that switch default also calls dev_warn to log an error, which is
this case will be either an unsupported format, or the YUYV format.

Obviously, the latter creates a spurious message. Make sure this isn't the
case.

Signed-off-by: Maxime Ripard <maxime.ripard at bootlin.com>
---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index 9a25aad8b6b1..e0b39ea641aa 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -357,6 +357,10 @@ static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev,
 			break;
 		}
 		break;
+
+	case V4L2_PIX_FMT_YUYV:
+		return CSI_INPUT_SEQ_YUYV;
+
 	default:
 		dev_warn(sdev->dev, "Unsupported pixformat: 0x%x, defaulting to YUYV\n",
 			 pixformat);
-- 
2.14.3




More information about the linux-arm-kernel mailing list