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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A9FB0C46467 for ; Mon, 16 Jan 2023 10:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc: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=5ZvaO4Ccmgu6qLP/DrShNYIg6t2tSs5KWeOyLd3BahU=; b=sPjpnwI4QiCw85R5Nkr3R6W2gb CP7a2L4yPyTVAtwN0pSTuOxIEIK9gWUitMm1iEmCkUrGrzSywmhXHvASUqePc6L50RC2ryCf9h8wo DDiInlHpcMwFvrbaXx93Nd4sTmli+FGskbhTgCgOA/Xu9qBeV6bxXpTWLXMhBxPpl+A++vx0KgiP4 DiluIcCsFFj69MC0dcg765Iy0QBnHlrLlH4/NZcoLK+BMO8SCbJADW5Lf7tJAm2q2DZLwNlmKwcaK HvOmEDlNSDZZBwuyS/T707RQ0o7TIKx2UJcpF1RRXU286qdHxVJLTqLE+/YBgbiT2+OlB8RGEaY9W q5sDc/Sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHMYE-009bwr-V5; Mon, 16 Jan 2023 10:17:15 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHMY2-009bqu-0W for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2023 10:17:03 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id E6215320010B; Mon, 16 Jan 2023 05:16:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 16 Jan 2023 05:16:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1673864215; x=1673950615; bh=ohPYesaxXk sV3W2txrimDtAtBAhmW/4R6Nx2mCz0Zps=; b=Eaw8Xd2GS61lnPC+MNep66n+dC PCUEhiMxdPbFe1k/kw5XTMvIPinamdKeTutSmSfmd7YA1ukylFaGz4nNxf1J5YEu IjhQvqFv7MvCbxLOKdNhdS/+r+/t9Qz+TeEaBx/YHpnK9PmiZDXYTPZ1y1D077Ze ZwpbCMohYzcyOEzwbOQzHOD/H7AO5uKdQjn1L0Ow4vWcCzrnuHS50N9cPj8H52O8 rbfoddzAOLKxrY4VOHazuz4cIGmLYwLli3jczhATfEQWqF9PKYLsCBhVUUwSGOby soypM3N0+un9uIwXY4iJlqES2K4xH7WR89IzLB0T998cHYoqXLWMhCzdFu7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1673864215; x=1673950615; bh=ohPYesaxXksV3W2txrimDtAtBAhm W/4R6Nx2mCz0Zps=; b=QyYpzpoC4JaiDhO9oOtlWLeMQJbky/neCi0IjmmzKyIw pNRw0vNqn35ekGLaYLMqTmPBKODOdBvLGGdrVWZG0KkRor67veTQcvjNqY35s+ll jhMAnfXJw+zMCJVMTM8LitiIqM3/diIkO0ZufNcx/pxWNkivpvKMcYMK2gxjWsDJ eLoYi1aydXHMXgW2GC3f/SfRKTHjWWm91r6HeKqm/RdNeXLRNAvUeQvyWlegq4oh Wi7mbgOhI0yC27c2wPQLdORbTS8wlUQxEQjGa0XT+TCPTo4gXRerGh294X4WTmP6 WZ19W+iBIaHKZDX8vvc3s3ba1sKTRUJSC9wHN1bwdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddtgedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfhfgggtuggjsehgtd erredttddvnecuhfhrohhmpeforgigihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegt vghrnhhordhtvggthheqnecuggftrfgrthhtvghrnheptdelkeejiedufedvhfeiffetle fhiedvleeigfeiuefghfdvleeiffejieegteejnecuffhomhgrihhnpehkvghrnhgvlhdr ohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 16 Jan 2023 05:16:54 -0500 (EST) Date: Mon, 16 Jan 2023 11:16:51 +0100 From: Maxime Ripard To: Oleg Verych Cc: wens@kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, mark.rutland@arm.com, mchehab@kernel.org, robh+dt@kernel.org, sakari.ailus@linux.intel.com, wens@csie.org Subject: Re: [PATCH 04/14] media: sun4i-csi: Fix [HV]sync polarity handling Message-ID: <20230116101651.jjzz2rcdehs5wvsi@houat> References: <20191215165924.28314-5-wens@kernel.org> <20230116100359.4479-1-olecom@gmail.com> MIME-Version: 1.0 In-Reply-To: <20230116100359.4479-1-olecom@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_021702_241966_6E512495 X-CRM114-Status: GOOD ( 19.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3652859288244870540==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3652859288244870540== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="d42kwkvwzbbj3usb" Content-Disposition: inline --d42kwkvwzbbj3usb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jan 16, 2023 at 01:03:59PM +0300, Oleg Verych wrote: > > - hsync_pol =3D !!(bus->flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH); > > - vsync_pol =3D !!(bus->flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH); > > + /* > > + * This hardware uses [HV]REF instead of [HV]SYNC. Based on the > > + * provided timing diagrams in the manual, positive polarity > > + * equals active high [HV]REF. > > + * > > + * When the back porch is 0, [HV]REF is more or less equivalent > > + * to [HV]SYNC inverted. > > + */ > > + href_pol =3D !!(bus->flags & V4L2_MBUS_HSYNC_ACTIVE_LOW); > > + vref_pol =3D !!(bus->flags & V4L2_MBUS_VSYNC_ACTIVE_LOW); >=20 > After this change has been made there is a need of explicit explanation > of what "Active high" / "Active low" in dts really mean. Why? Active high means that the signal is considered active when it is held high. Active low means that the signal is considered active when it is low. > Currently physical high/low voltage levels are like that: > (I'm not sure about vsync-active) >=20 > * hsync-active =3D <0>; /* HSYNC active 'low' =3D> wire active is 'high' = */ Yes > CSI register setting: href_pol: 1, Not really, no. It's what this patch commit log is saying: HREF is !HSYNC, so in order to get a hsync pulse active high, you need to set href_pol to 0. > That is confusing: >=20 > [PATCH v6 5/5] DO NOT MERGE: ARM: dts: bananapi: Add Camera support > https://lore.kernel.org/linux-arm-kernel/cf0e40b0bca9219d2bb023a5b7f23bad= 8baba1e5.1562847292.git-series.maxime.ripard@bootlin.com/#r >=20 > > + port { > > + csi_from_ov5640: endpoint { > > + remote-endpoint =3D <&ov5640_to_csi>; > > + bus-width =3D <8>; > > + hsync-active =3D <1>; /* Active high */ >=20 > original CSI driver >=20 > > + vsync-active =3D <0>; /* Active low */ > > + data-active =3D <1>; /* Active high */ > > + pclk-sample =3D <1>; /* Rising */ > > + }; > > + }; >=20 > [PATCH 13/14] [DO NOT MERGE] ARM: dts: sun7i: cubieboard2: Enable OV7670 = camera on CSI1 > https://lore.kernel.org/linux-arm-kernel/20191215165924.28314-14-wens@ker= nel.org/ >=20 > > + port { > > + /* Parallel bus endpoint */ > > + csi_from_ov7670: endpoint { > > + remote-endpoint =3D <&ov7670_to_csi>; > > + bus-width =3D <8>; > > + /* driver is broken */ > > + hsync-active =3D <0>; /* Active high */ >=20 > this change patchset >=20 > > + vsync-active =3D <1>; /* Active high */ > > + data-active =3D <1>; /* Active high */ > > + pclk-sample =3D <1>; /* Rising */ > > + }; >=20 > > + ov7670_to_csi: endpoint { > > + remote-endpoint =3D <&csi_from_ov7670>; > > + bus-width =3D <8>; > > + hsync-active =3D <1>; /* Active high */ >=20 > this patcheset >=20 > > + vsync-active =3D <1>; /* Active high */ > > + data-active =3D <1>; /* Active high */ > > + pclk-sample =3D <1>; /* Rising */ > > + }; > > + }; I'm sorry, it's not clear to me what is confusing in those excerpts? Maxime --d42kwkvwzbbj3usb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCY8UkEwAKCRDj7w1vZxhR xTMkAP4+TgmiQeIUnqkQdGHMurxhX6R1RMA0WARr69iNcT7I+AD/ZaGQUas8YGRi CYDPVdJ5hhgKlTctilLgpPIaA55YmwE= =QilM -----END PGP SIGNATURE----- --d42kwkvwzbbj3usb-- --===============3652859288244870540== 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 --===============3652859288244870540==--