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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 D72C9C4363A for ; Tue, 27 Oct 2020 09:32:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 655BA2224E for ; Tue, 27 Oct 2020 09:32:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PTh+Ihj3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 655BA2224E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AZLrLAIMf+uk2Y0UNE/tUksKeFIh/wK/6bpxAR71qKY=; b=PTh+Ihj3WYrzKAjexSsNgRNLa f0JtxYJDjnRZXWtXzVVcrZZGAbQC0x330pXLv6dEKukAyxBZmnqiEc4IaRxPaDYOfY6G/4auD+a7x 7WjU561mI16t2l5yvHd8+yK52t7miVa6yfk0UlqbuUzK51eRGUT6ItS9Xd04fAvQfr/Ce9DvHGgdb ngEMlvWRPixhOid/m6s3R7flxGYGSTH6xZCslJmmcxocInv7cMNW8pRm0iax6DYLba9EwYt0lPcb2 RPPkWA3Ma2A28xtz7MGyxHk0+dVe9zTRUaNTh+SGMPMwOuUis6oDKg03/If3h+JLRb4Q99tDZgI7o ngaj9p2Ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLKL-0002fG-1q; Tue, 27 Oct 2020 09:31:37 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXLKH-0002e6-CB for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 09:31:34 +0000 X-Originating-IP: 93.29.109.196 Received: from aptenodytes (196.109.29.93.rev.sfr.net [93.29.109.196]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 592B71BF212; Tue, 27 Oct 2020 09:31:21 +0000 (UTC) Date: Tue, 27 Oct 2020 10:31:19 +0100 From: Paul Kocialkowski To: Maxime Ripard Subject: Re: [PATCH 05/14] media: sun6i-csi: Only configure the interface data width for parallel Message-ID: <20201027093119.GD168350@aptenodytes> References: <20201023174546.504028-1-paul.kocialkowski@bootlin.com> <20201023174546.504028-6-paul.kocialkowski@bootlin.com> <20201026160035.sr6kifrpkev773o6@gilmour.lan> MIME-Version: 1.0 In-Reply-To: <20201026160035.sr6kifrpkev773o6@gilmour.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_053133_669560_E918DF56 X-CRM114-Status: GOOD ( 28.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Philipp Zabel , Kishon Vijay Abraham I , Thomas Petazzoni , Greg Kroah-Hartman , =?utf-8?B?S8OpdmluIEwnaMO0cGl0YWw=?= , Helen Koike , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Hans Verkuil , linux-sunxi@googlegroups.com, Rob Herring , Vinod Koul , Yong Deng , Sakari Ailus , Hans Verkuil , Mauro Carvalho Chehab , kevin.lhopital@hotmail.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: multipart/mixed; boundary="===============9188877532281736611==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============9188877532281736611== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5gxpn/Q6ypwruk0T" Content-Disposition: inline --5gxpn/Q6ypwruk0T Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon 26 Oct 20, 17:00, Maxime Ripard wrote: > On Fri, Oct 23, 2020 at 07:45:37PM +0200, Paul Kocialkowski wrote: > > Bits related to the interface data width do not have any effect when > > the CSI controller is taking input from the MIPI CSI-2 controller. >=20 > I guess it would be clearer to mention that the data width is only > applicable for parallel here. Understood, will change the wording in the next version. > > In prevision of adding support for this case, set these bits > > conditionally so there is no ambiguity. > >=20 > > Co-developed-by: K=C3=A9vin L'h=C3=B4pital > > Signed-off-by: K=C3=A9vin L'h=C3=B4pital > > Signed-off-by: Paul Kocialkowski > > --- > > .../platform/sunxi/sun6i-csi/sun6i_csi.c | 42 +++++++++++-------- > > 1 file changed, 25 insertions(+), 17 deletions(-) > >=20 > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drive= rs/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > index 5d2389a5cd17..a876a05ea3c7 100644 > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > @@ -378,8 +378,13 @@ static void sun6i_csi_setup_bus(struct sun6i_csi_d= ev *sdev) > > unsigned char bus_width; > > u32 flags; > > u32 cfg; > > + bool input_parallel =3D false; > > bool input_interlaced =3D false; > > =20 > > + if (endpoint->bus_type =3D=3D V4L2_MBUS_PARALLEL || > > + endpoint->bus_type =3D=3D V4L2_MBUS_BT656) > > + input_parallel =3D true; > > + > > if (csi->config.field =3D=3D V4L2_FIELD_INTERLACED > > || csi->config.field =3D=3D V4L2_FIELD_INTERLACED_TB > > || csi->config.field =3D=3D V4L2_FIELD_INTERLACED_BT) > > @@ -395,6 +400,26 @@ static void sun6i_csi_setup_bus(struct sun6i_csi_d= ev *sdev) > > CSI_IF_CFG_HREF_POL_MASK | CSI_IF_CFG_FIELD_MASK | > > CSI_IF_CFG_SRC_TYPE_MASK); > > =20 > > + if (input_parallel) { > > + switch (bus_width) { > > + case 8: > > + cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_8BIT; > > + break; > > + case 10: > > + cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_10BIT; > > + break; > > + case 12: > > + cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_12BIT; > > + break; > > + case 16: /* No need to configure DATA_WIDTH for 16bit */ > > + break; > > + default: > > + dev_warn(sdev->dev, "Unsupported bus width: %u\n", > > + bus_width); > > + break; > > + } > > + } > > + > > if (input_interlaced) > > cfg |=3D CSI_IF_CFG_SRC_TYPE_INTERLACED; > > else > > @@ -440,23 +465,6 @@ static void sun6i_csi_setup_bus(struct sun6i_csi_d= ev *sdev) > > break; > > } > > =20 > > - switch (bus_width) { > > - case 8: > > - cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_8BIT; > > - break; > > - case 10: > > - cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_10BIT; > > - break; > > - case 12: > > - cfg |=3D CSI_IF_CFG_IF_DATA_WIDTH_12BIT; > > - break; > > - case 16: /* No need to configure DATA_WIDTH for 16bit */ > > - break; > > - default: > > - dev_warn(sdev->dev, "Unsupported bus width: %u\n", bus_width); > > - break; > > - } > > - >=20 > Is there any reason to move it around? The main reason is cosmetics: input_parallel is introduced to match the alr= eady existing input_interlaced variable, so it made sense to me to have both of = these conditionals one after the other instead of spreading them randomly. I can mention this in the commit log if you prefer. --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --5gxpn/Q6ypwruk0T Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl+X6OcACgkQ3cLmz3+f v9E4ZAf9G4WrazCR7uzhJ6TzaObPDuK3ZcpoqfZh7GopUZHGTQkIg1MdpqnZTUor NXm7n2mI41WUp9/F7URC05l8+ySbojy6jjIhGdf9IorawBgrlRAVplqPJaF2uuWD NnxVIys2WTw2FwHrh3zEVHKJPO+1qTleIoBPu5WFodwsvz/Pb2zVS2/Kdtv5KhXa G1GBNQ7UlQqvbShqs7f5LoYlp9GHuB8/NmVHH/jP89BhpDBTbsYLWQXjvs6fqNgb ggICWUXB5Uwjfsj8PWcFBXJFStux5NoeOypCLJCxKau86uphz6VLodbj/T2VvmCW qmjrvw6LqmyPx5pJpg9gPupbc+plpw== =qqnp -----END PGP SIGNATURE----- --5gxpn/Q6ypwruk0T-- --===============9188877532281736611== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============9188877532281736611==--