RE: [EXTERNAL] Re: [PATCH v4 2/5] dt-bindings: spi: cadence: Add MRVL overlay bindings documentation for Cadence XSPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> ----------------------------------------------------------------------
> 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 for hints.
Yaml file will be reworked to match guideliness

> 
> Thanks,
> Conor.

Regards
Witek





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux