[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240509-hurried-canned-3ceac439b93d@spud>
Date: Thu, 9 May 2024 18:22:15 +0100
From: Conor Dooley <conor@...nel.org>
To: Witold Sadowski <wsadowski@...vell.com>
Cc: linux-kernel@...r.kernel.org, linux-spi@...r.kernel.org,
devicetree@...r.kernel.org, broonie@...nel.org, robh@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
pthombar@...ence.com
Subject: Re: [PATCH v4 2/5] dt-bindings: spi: cadence: Add MRVL overlay
bindings documentation for Cadence XSPI
Hey Witold,
On Wed, May 08, 2024 at 06:05:20PM -0700, Witold Sadowski wrote:
> allOf:
> - $ref: spi-controller.yaml#
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: marvell,cn10-xspi-nor
> + then:
> + properties:
> + reg-names:
> + items:
> + - const: io
> + - const: sdma
> + - const: aux
> + - const: xferbase
> + reg:
> + items:
> + - description: address and length of the controller register set
> + - description: address and length of the Slave DMA data port
> + - description: address and length of the auxiliary registers
> + - description: address and length of the xfer registers
> + else:
> + properties:
> + reg-names:
> + items:
> + - const: io
> + - const: sdma
> + - const: aux
> + reg:
> + items:
> + - description: address and length of the controller register set
> + - description: address and length of the Slave DMA data port
> + - description: address and length of the auxiliary registers
The usual approach here is to define the loosest possible constraints
at the top level, so unconditionally define the xfer register region,
and then constrain things based on compatible. In this case, you can set
minItems to 3 unconditionally and then do (in psuedocode):
if:
marvell
then:
reg:
minitems: 4
else
reg:
maxItems: 3
Additionally, when the allOf: is more then just references to other
documents, it should be moved below the required list.
Thanks,
Conor.
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists