Re: [PATCH 1/1] dt-bindings: net: convert qca,qca7000.txt yaml format
From: Krzysztof Kozlowski
Date: Mon Jun 02 2025 - 16:21:46 EST
On 02/06/2025 17:35, Frank Li wrote:
>
>>> +
>>> +properties:
>>> + compatible:
>>> + const: qca,qca7000
>>> +
>>> + reg:
>>> + maxItems: 1
>>> +
>>> + interrupts:
>>> + maxItems: 1
>>> +
>>> + spi-cpha: true
>>> +
>>> + spi-cpol: true
>> In case of a SPI setup these properties should be required. Unfortunately
>> i'm not sure how to enforce this. Maybe depending on the presence of "reg"?
>
> But It think depend on reg is not good idea, which too obscure. Ideally it
> should be use two compatible strings. It should treat as two kinds device.
> It is really old devices and not worth to update compatible string.
>
> Maybe some one in dt team can provide suggestion!
>
> Rob and Krzysztof Kozlowski:
> any idea about this?
You can check for reg and require these, e.g.:
https://elixir.bootlin.com/linux/v6.4-rc7/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L191
See also for very similar case:
Documentation/devicetree/bindings/net/dsa/realtek.yaml
However for multi-bus devices we usually do not code such constraints.
Partially because of typical cases - i2c and spi - it would not be possible.
Best regards,
Krzysztof