From patchwork Mon Mar 5 09:35:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 10258473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99E0960365 for ; Mon, 5 Mar 2018 09:35:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 897EA2899E for ; Mon, 5 Mar 2018 09:35:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CE1D289B1; Mon, 5 Mar 2018 09:35:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 206412899E for ; Mon, 5 Mar 2018 09:35:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933713AbeCEJf4 (ORCPT ); Mon, 5 Mar 2018 04:35:56 -0500 Received: from mail.bootlin.com ([62.4.15.54]:49563 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933714AbeCEJfu (ORCPT ); Mon, 5 Mar 2018 04:35:50 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 6EB75207E9; Mon, 5 Mar 2018 10:35:48 +0100 (CET) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 17AAD207EF; Mon, 5 Mar 2018 10:35:38 +0100 (CET) From: Maxime Ripard To: Yong Deng Cc: Mauro Carvalho Chehab , Chen-Yu Tsai , Maxime Ripard , Hans Verkuil , Sakari Ailus , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Mylene Josserand Subject: [PATCH 5/7] media: sun6i: Support the YUYV format properly Date: Mon, 5 Mar 2018 10:35:32 +0100 Message-Id: <20180305093535.11801-6-maxime.ripard@bootlin.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180305093535.11801-1-maxime.ripard@bootlin.com> References: <1519697113-32202-1-git-send-email-yong.deng@magewell.com> <20180305093535.11801-1-maxime.ripard@bootlin.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);