From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wnew4-smtp.messagingengine.com (wnew4-smtp.messagingengine.com [64.147.123.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD1D33FC4; Tue, 14 Sep 2021 12:06:43 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id CC9CC2B01378; Tue, 14 Sep 2021 08:06:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 14 Sep 2021 08:06:43 -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=fm3; bh=yfkVLActGZMW68g0rs5VgSAOO6b 1fyb8KwcUxANrGvI=; b=Cl+efySlyeLdlJ76DlnUc3lHR0Ma1FNQuBgjIKyF2IX 2iyE9TvmSmfmbH3Gw45cSg25pmOIUxrIssx4+3jHb4aIZi5Q47MT2n+Y1GuXW2zW M8Yt6WLEPihW7JVv/Z3RtktTRTHX+ppYre0vpwENysxJJaDtpGrVJc3qtYBhgKl8 W/J1uOGyVjAy9eb33aSJbmPU2JK+grc3LLX5XA/UZL4aM8p3HdlPei76essp8Wvj pgp1v01aab/IInvuMT7DeTzqoBrupy8jq1EBbzQiV+beujxTdSrinubb5/0EYISb ulvRwQRyj9YDqfpdkbviEUM0/gYiS2aFPVB6XYq90yg== 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=fm3; bh=yfkVLA ctGZMW68g0rs5VgSAOO6b1fyb8KwcUxANrGvI=; b=KnJSO2rPQinOv/9FwMKY4b AQhn60d1b3wVFPPKFrMili2ucoOsbmLTcxs7XdmUTqIhLX4/hd6nwYEUnZodnDfn 3jh7QMe4boupn3A6ZO00fJYG18z5+6PeMlcgrYhIJ83vFZsQlkXIhMNVlN3DPMis M90ThZsx2Aebx20+uXkaOCYK81sCmDCHwtIuAbFNA4lTF35ZRhsO2Jpw5unKirER lMiQ4TYsbsTvpbYE9xDqReUkZVkfjT6/v+HrXtsqR3vYwrMSK/IXiG1tWMJUk4ZF QLyD889Wwj0D6y3NiQNvj+Khom6VQMdjrGoaDc4+r0CRGl3dMOURbJ/zKY+rbavw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegledggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Sep 2021 08:06:38 -0400 (EDT) Date: Tue, 14 Sep 2021 14:06:37 +0200 From: Maxime Ripard To: Paul Kocialkowski Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, linux-staging@lists.linux.dev, Yong Deng , Mauro Carvalho Chehab , Rob Herring , Sakari Ailus , Hans Verkuil , Chen-Yu Tsai , Jernej Skrabec , Greg Kroah-Hartman , Helen Koike , Laurent Pinchart , Thomas Petazzoni , Rob Herring Subject: Re: [PATCH 05/22] dt-bindings: media: sun6i-a31-csi: Add MIPI CSI-2 input port Message-ID: <20210914120637.dpaig2nx6i45hkec@gilmour> References: <20210910184147.336618-1-paul.kocialkowski@bootlin.com> <20210910184147.336618-6-paul.kocialkowski@bootlin.com> <20210913080931.opbtx45sxqu52jxe@gilmour> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ls7hdd33ltqkrebg" Content-Disposition: inline In-Reply-To: --ls7hdd33ltqkrebg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 14, 2021 at 09:43:08AM +0200, Paul Kocialkowski wrote: > Hi, >=20 > On Mon 13 Sep 21, 10:09, Maxime Ripard wrote: > > On Fri, Sep 10, 2021 at 08:41:30PM +0200, Paul Kocialkowski wrote: > > > The A31 CSI controller supports two distinct input interfaces: > > > parallel and an external MIPI CSI-2 bridge. The parallel interface > > > is often connected to a set of hardware pins while the MIPI CSI-2 > > > bridge is an internal FIFO-ish link. As a result, these two inputs > > > are distinguished as two different ports. > > >=20 > > > Note that only one of the two may be present on a controller instance. > > > For example, the V3s has one controller dedicated to MIPI-CSI2 and one > > > dedicated to parallel. > > >=20 > > > Update the binding with an explicit ports node that holds two distinct > > > port nodes: one for parallel input and one for MIPI CSI-2. > > >=20 > > > This is backward-compatible with the single-port approach that was > > > previously taken for representing the parallel interface port, which > > > stays enumerated as fwnode port 0. > > >=20 > > > Note that additional ports may be added in the future, especially to > > > support feeding the CSI controller's output to the ISP. > > >=20 > > > Signed-off-by: Paul Kocialkowski > > > Reviewed-by: Rob Herring > > > Acked-by: Maxime Ripard > > > --- > > > .../media/allwinner,sun6i-a31-csi.yaml | 75 +++++++++++++++--= -- > > > 1 file changed, 62 insertions(+), 13 deletions(-) > > >=20 > > > diff --git a/Documentation/devicetree/bindings/media/allwinner,sun6i-= a31-csi.yaml b/Documentation/devicetree/bindings/media/allwinner,sun6i-a31-= csi.yaml > > > index 8b568072a069..f4a686b77a38 100644 > > > --- a/Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi= =2Eyaml > > > +++ b/Documentation/devicetree/bindings/media/allwinner,sun6i-a31-csi= =2Eyaml > > > @@ -61,6 +61,49 @@ properties: > > > =20 > > > additionalProperties: false > > > =20 > > > + ports: > > > + $ref: /schemas/graph.yaml#/properties/ports > > > + > > > + properties: > > > + port@0: > > > + $ref: /schemas/graph.yaml#/$defs/port-base > > > + description: Parallel input port, connect to a parallel sens= or > > > + > > > + properties: > > > + reg: > > > + const: 0 > > > + > > > + endpoint: > > > + $ref: video-interfaces.yaml# > > > + unevaluatedProperties: false > > > + > > > + properties: > > > + bus-width: > > > + enum: [ 8, 10, 12, 16 ] > > > + > > > + pclk-sample: true > > > + hsync-active: true > > > + vsync-active: true > > > + > > > + required: > > > + - bus-width > > > + > > > + additionalProperties: false > >=20 > > You don't have to duplicate the entire definition there, you can just > > reference port: > >=20 > > $ref: #/properties/port >=20 > And that would reference the local (previous) definition of the port node? Yep. You can't use additionalProperties anymore though, but only unevaluatedProperties since additionalProperties is about the current schema (ie, every below port@0 here), while unevaluatedProperties is about the sum of all the schemas. > Sounds like a good thing indeed. > > > + port@1: > > > + $ref: /schemas/graph.yaml#/$defs/port-base > > > + description: MIPI CSI-2 bridge input port > > > + > > > + properties: > > > + reg: > > > + const: 1 > > > + > > > + endpoint: > > > + $ref: video-interfaces.yaml# > > > + unevaluatedProperties: false > > > + > > > + additionalProperties: false > > > + > >=20 > > port@0 is required? >=20 > It shouldn't be required. Does that call for a change here? I guess you'd at least need one of the two? So something like this should work anyOf: - required: - port@0 - required: - port@1 > > And at the top-level, either ports or port are required too >=20 > Yes I guess that is true. Should that be a required+oneOf type of thing? Yes, anyOf is an OR, oneOf a XOR. I don't think it makes sense to have ports and port there. Maxime --ls7hdd33ltqkrebg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYUCQTQAKCRDj7w1vZxhR xVY0AQC0MzwuomSb5c5Fgv85f1YABbZl/usW1RpLFc/A86BSgAD+IXKAZTi4a+Im jo0PlN3KwTvKKVqnAGtwPT6IAzjArwI= =yj8h -----END PGP SIGNATURE----- --ls7hdd33ltqkrebg--