Re: [PATCH] dt-bindings: fpga: microchip,mpf-spi-fpga-mgr: use spi-peripheral-props.yaml
From: Krzysztof Kozlowski
Date: Wed Jul 27 2022 - 15:28:20 EST
On 27/07/2022 18:57, Conor.Dooley@xxxxxxxxxxxxx wrote:
> Hey Krzysztof,
>
> On 27/07/2022 17:43, Krzysztof Kozlowski wrote:
>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>
>> Instead of listing directly properties typical for SPI peripherals,
>> reference the spi-peripheral-props.yaml schema. This allows using all
>> properties typical for SPI-connected devices, even these which device
>> bindings author did not tried yet.
>>
>> Remove the spi-* properties which now come via spi-peripheral-props.yaml
>> schema, except for the cases when device schema adds some constraints
>> like maximum frequency.
>>
>> While changing additionalProperties->unevaluatedProperties, put it in
>> typical place, just before example DTS.
>
> This is probably just me missing something about dt-schema norms,
> but how come you added the $ref just above the example rather than
> above the properties list?
AFAIU, the location is purely by convention so far. allOf with refs go
before properties, but with "if:then" they go after required. This is a
bit confusing and causes unneeded code move when someone adds "if:" to
such allOf. Additionally the spi-peripheral-props.yaml ref is actually
not that important, unlike other refs (e.g. panels referencing
panel-common.yaml, watchdog -> watchdog.yaml).
Therefore for consistency with all other SPI slave devices I put it at
the end, but if you find it inconsistent/messing up, I can move it
before properties.
Best regards,
Krzysztof