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 6A106C55178 for ; Tue, 27 Oct 2020 18:32:58 +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 E8C8A20709 for ; Tue, 27 Oct 2020 18: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="hPOyukIO"; dkim=temperror (0-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="rGRlQhRM"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Mf1sZYH1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8C8A20709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech 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=zDYKpoe8H2NgeqW/AH5bEh236+BmVJdJgbDZMj3inSg=; b=hPOyukIOD2SzYQrU6EdwrJ0Lq Y5e76VJXp0hh2CsPo5Nqjz98DoCNtUNnL1+qQgZkChquALACl35jBTz7Qgn322GT1tHdsJmGXpC0d Arg43YEfy7E5MsU6Mn6fsIRV67Y/eggksX6TCioZqZA1N8fbPfxnw2CwL3VAr/hCs81wz8rvOa7xF Ns4zAdtEjgUYJJi7d/uQJ9gxp4SRl2sbSxNB4ZuW647zfIVV2rgmVzAndx3gU5YZ4EVBcXa05Ngti xEtk1EvOIQmjcdEgySvMpRuF2FzlFlnbBB1vEprw1qPVPHLIisSX/PX8ShrF+qxgk0iklInDre8CQ EShrLXuCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTkZ-0002Fx-4K; Tue, 27 Oct 2020 18:31:15 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXTkW-0002FN-EC for linux-arm-kernel@lists.infradead.org; Tue, 27 Oct 2020 18:31:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 06047580124; Tue, 27 Oct 2020 14:31:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 27 Oct 2020 14:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=cqEApD9bNAy57QPWXCIsEAVmHi2 EXCNHlS0Cgqo2X94=; b=rGRlQhRMZctKbHoVVx7plOw8460fHGVy1rIkJERfJ68 m0cXpO/1m8ioFGbSZ7Mmn00NDt1zy90g8BP1UAK5Ka5vr/YjsxFRSK+ZVW5V17/t DWf/Fp4dCIQS75RyU2y5acJKC5m5XJnh8b6mf+AqeKljwaKYjy1kDYpkdPSIgDAL LpGug3ba/FFM50oDljluDoOxpQtfXOZbWqd4zz/8rfWdVkFU9NsGJ1h2sxekf5Af WFGKueFomjp7kv/PtPee8B/YPGHsD1rcQ4YP3OvoFrTJGt7dqxaK3mng0ijZST+c GVOXnQkR39yy0nJZAVciAAEkXRMCSCaw1A2RqAKNDOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=cqEApD 9bNAy57QPWXCIsEAVmHi2EXCNHlS0Cgqo2X94=; b=Mf1sZYH1Q4Y47ymBY8cIAm sklnWxwyr0GmYNvLkDvmBIcQjXalpF5Aae12XQ23sAhMZxOV1YjQfTSmomZMVBSq Jrz5yrnEvhzG4hleuOElgzcWL7orU+QpbWa6bNMnB2sgplx3BfWAdS3KUBFLqo7V dGb5sylsqJlMSAKZ6GcNEfHkSlKtbDozGEoGi7pkVaNkVDymIvrmuIU4c8qQ/iyT IcgbtapixtbbUSdN4AYFMWYVNcOjgHNVHtLoba2RTR08BiEzJNYPmC5NacgGxYra nLvZoI6U6vh88Tf8yeoTpxCFmVIOt+sxpbSWtoccHo41nXmEE4PGCribreRdhkOg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkeelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepuddvudfhkeekhefgffetffelgffftdehffduffegveetffehueeivddvjedv gfevnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id E385B3064683; Tue, 27 Oct 2020 14:31:08 -0400 (EDT) Date: Tue, 27 Oct 2020 19:31:07 +0100 From: Maxime Ripard To: Paul Kocialkowski Subject: Re: [PATCH 05/14] media: sun6i-csi: Only configure the interface data width for parallel Message-ID: <20201027183107.sofqfbmgg5aancmr@gilmour.lan> References: <20201023174546.504028-1-paul.kocialkowski@bootlin.com> <20201023174546.504028-6-paul.kocialkowski@bootlin.com> <20201026160035.sr6kifrpkev773o6@gilmour.lan> <20201027093119.GD168350@aptenodytes> MIME-Version: 1.0 In-Reply-To: <20201027093119.GD168350@aptenodytes> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201027_143112_532886_DE557D29 X-CRM114-Status: GOOD ( 30.24 ) 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="===============0225741456103668929==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============0225741456103668929== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xds6nfzydlmcpk4h" Content-Disposition: inline --xds6nfzydlmcpk4h Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 27, 2020 at 10:31:19AM +0100, Paul Kocialkowski wrote: > Hi, >=20 > 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. >=20 > Understood, will change the wording in the next version. >=20 > > > In prevision of adding support for this case, set these bits > > > conditionally so there is no ambiguity. > > >=20 > > > Co-developed-by: K=E9vin L'h=F4pital > > > Signed-off-by: K=E9vin L'h=F4pital > > > 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/dri= vers/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= _dev *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= _dev *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= _dev *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? >=20 > The main reason is cosmetics: input_parallel is introduced to match the a= lready > existing input_interlaced variable, so it made sense to me to have both o= f these > conditionals one after the other instead of spreading them randomly. >=20 > I can mention this in the commit log if you prefer. Yeah, that would great Maxime --xds6nfzydlmcpk4h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX5hnawAKCRDj7w1vZxhR xeemAPwI5/422bQUijrQXWpjRvLHcHc8Q+YVMP+kEvDRE9063QEAzaVJVId2nV7e pZYcb1nc2gvw1YyI1tTwdOxrxLcuhAM= =lTGY -----END PGP SIGNATURE----- --xds6nfzydlmcpk4h-- --===============0225741456103668929== 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 --===============0225741456103668929==--