Skip to content

Commit b57ce96

Browse files
krzkrobherring
authored andcommitted
docs: dt: writing-bindings: Express better expectations of "specific"
Devicetree bindings are supposed to be specific in terms of compatibles and other properties. Short "specific" has many implications, so extend the description to cover them: 1. Mention no family names and avoid generic SoC fallbacks in compatible. The list grew, mixing DO's and DON'T's, so split it into multiple items. 2. No properties implied by the compatible. 3. Document desired lack of ABI impact and acceptable solution if such needs arises: clearly marking it in commit msg. All above follows established Devicetree bindings maintainers review practice, so no new rules in practice are introduced here. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20250707095019.66792-5-krzysztof.kozlowski@linaro.org Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent 49ed686 commit b57ce96

1 file changed

Lines changed: 22 additions & 5 deletions

File tree

Documentation/devicetree/bindings/writing-bindings.rst

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ Overall design
3939
Properties
4040
==========
4141

42-
- DO make 'compatible' properties specific. DON'T use wildcards in compatible
43-
strings. DO use fallback compatibles when devices are the same as or a
44-
superset of prior implementations. DO add new compatibles in case there are
45-
new features or bugs.
42+
- DO make 'compatible' properties specific.
43+
44+
- DON'T use wildcards or device-family names in compatible strings.
45+
46+
- DO use fallback compatibles when devices are the same as or a superset of
47+
prior implementations.
48+
49+
- DO add new compatibles in case there are new features or bugs.
50+
51+
- DO use a SoC-specific compatible for all SoC devices, followed by a
52+
fallback if appropriate. SoC-specific compatibles are also preferred for
53+
the fallbacks.
4654

4755
- DO use a vendor prefix on device-specific property names. Consider if
4856
properties could be common among devices of the same class. Check other
@@ -51,12 +59,21 @@ Properties
5159
- DON'T redefine common properties. Just reference the definition and define
5260
constraints specific to the device.
5361

62+
- DON'T add properties to avoid a specific compatible. DON'T add properties if
63+
they are implied by (deducible from) the compatible.
64+
5465
- DO use common property unit suffixes for properties with scientific units.
5566
Recommended suffixes are listed at
5667
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml
5768

5869
- DO define properties in terms of constraints. How many entries? What are
59-
possible values? What is the order?
70+
possible values? What is the order? All these constraints represent the ABI
71+
as well.
72+
73+
- DON'T make changes that break the ABI without explicit and detailed rationale
74+
for why the changes have to be made and their impact. ABI impact goes beyond
75+
the Linux kernel, because it also covers other open-source upstream projects.
76+
6077

6178
Typical cases and caveats
6279
=========================

0 commit comments

Comments
 (0)