From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B531C10F13 for ; Tue, 16 Apr 2019 05:44:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCF502075B for ; Tue, 16 Apr 2019 05:44:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qiuI9Jsa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCF502075B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BubYG91D1vvUAq/J01mX1HfI2mwKjpJ8PSyVtfL3GhM=; b=qiuI9JsaCQ7zb2 kIBLsG/cTmrdPjIeeAfOIkwoRyyDzv1NsLQzCWVFImXkAOtbMi3c4fGuxlYh+GWACeAVaG0sNla18 VnNvdj7P3nYInzL2YeustKtU3512j9YasTCGToDwJqhGPHXIYTJ/BLRDuksZdzH4aRdcUg800NUw4 x5lEniJz0TrLtiz9GdHQrRNDjthr4mIbZt/UCoA6OPnHFKCDYxb3g5XsrKdXjuK9JPIGk6HkoC+dI LxnyuZmFNeylwhwzvSit9V7IOHvXJLdyBX9g46agpb6XrOxiDI9TSLR4PoEtBH6zgG7HdwGsOLHEg tVrU6dQrJwHk8S5JH75A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGGsr-0003Qq-Ln; Tue, 16 Apr 2019 05:43:53 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGGsT-0002zH-Jz; Tue, 16 Apr 2019 05:43:33 +0000 X-UUID: f4a3c3bf953548c49c28c9a202e9dcea-20190415 X-UUID: f4a3c3bf953548c49c28c9a202e9dcea-20190415 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 397916428; Mon, 15 Apr 2019 21:42:47 -0800 Received: from MTKMBS01N1.mediatek.inc (172.21.101.68) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 15 Apr 2019 22:42:45 -0700 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 13:42:43 +0800 Received: from [172.21.84.99] (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 13:42:44 +0800 Message-ID: <1555393364.9968.2.camel@mtksdccf07> Subject: Re: [PATCH 03/14] [media] mtk-mipicsi: add color format support for mt2712 From: Stu Hsieh To: CK Hu Date: Tue, 16 Apr 2019 13:42:44 +0800 In-Reply-To: <1554790709.10331.6.camel@mtksdaap41> References: <1554724505-19882-1-git-send-email-stu.hsieh@mediatek.com> <1554724505-19882-4-git-send-email-stu.hsieh@mediatek.com> <1554790709.10331.6.camel@mtksdaap41> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190415_224329_817144_08784ADA X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, CK: On Tue, 2019-04-09 at 14:18 +0800, CK Hu wrote: > Hi, Stu: > > On Mon, 2019-04-08 at 19:54 +0800, Stu Hsieh wrote: > > This patch add color format support for mt2712 > > Without this patch, I think this driver still support these color > format. In this patch, you just check for the non-supported color > format. > > > > > Signed-off-by: Stu Hsieh > > --- > > .../media/platform/mtk-mipicsi/mtk_mipicsi.c | 25 +++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > > > diff --git a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > > index a5ed720df900..ccf2d18a3e74 100644 > > --- a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > > +++ b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c > > @@ -139,6 +139,25 @@ static void mtk_mipicsi_remove_device(struct soc_camera_device *icd) > > (void)pm_runtime_put_sync(icd->parent); > > } > > > > +static bool is_supported(struct soc_camera_device *icd, const u32 pixformat) > > icd is useless, so remove it. > > > +{ > > + bool ret = false; > > + > > + switch (pixformat) { > > + /* YUV422 */ > > + case V4L2_PIX_FMT_YUYV: > > + case V4L2_PIX_FMT_UYVY: > > + case V4L2_PIX_FMT_YVYU: > > + case V4L2_PIX_FMT_VYUY: > > + ret = true; > > You could just return true. > > > + break; > > + default: > > + break; > > You don't need the 'default' part. > > > + } > > + > > + return ret; > > You could just return false. > > Regards, > CK > Ok, I would modify it in next version. > > +} > > + > > static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > > struct v4l2_format *f) > > { > > @@ -154,6 +173,12 @@ static int mtk_mipicsi_set_fmt(struct soc_camera_device *icd, > > struct v4l2_mbus_framefmt *mf = &format.format; > > int ret = 0; > > > > + if (!is_supported(icd, pix->pixelformat)) { > > + dev_err(dev, "Format %x not support. set V4L2_PIX_FMT_YUYV as default\n", > > + pix->pixelformat); > > + pix->pixelformat = V4L2_PIX_FMT_YUYV; > > + } > > + > > xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); > > if (xlate == NULL) { > > dev_err(dev, "Format 0x%x not found\n", pix->pixelformat); > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel