[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8fe9ccd9-ec66-4174-896e-01501b8ad8ec@linaro.org>
Date: Fri, 5 Sep 2025 08:49:01 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Frank Li <Frank.li@....com>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] docs: dt: writing-schema: Describe defining properties in
top-level
On 04/09/2025 17:30, Frank Li wrote:
>> diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst
>> index 470d1521fa17..e0859094575d 100644
>> --- a/Documentation/devicetree/bindings/writing-schema.rst
>> +++ b/Documentation/devicetree/bindings/writing-schema.rst
>> @@ -165,6 +165,14 @@ The YAML Devicetree format also makes all string values an array and scalar
>> values a matrix (in order to define groupings) even when only a single value
>> is present. Single entries in schemas are fixed up to match this encoding.
>>
>> +When bindings cover multiple similar devices that differ in some properties,
>> +those properties should be constrained for each device. This usually means:
>> +
>> + * In top level 'properties' define the property with the broadest constraints.
>> + * In 'if:then:' blocks, further narrow the constraints for those properties.
>> + * Do not define the properties within an 'if:then:' block (note that
>> + 'additionalItems' also won't allow that).
>> +
>
> I can understand what your said. I think it would be better if add some
> simple examples.
Example for that is already there - at the bottom of this file.
Best regards,
Krzysztof
Powered by blists - more mailing lists