Skip to content

Commit a1d87a3

Browse files
krzkrobherring
authored andcommitted
docs: dt: writing-bindings: Document compatible and filename naming
Document established Devicetree bindings maintainers review practices: 1. Compatibles should not use bus suffixes to encode the type of interface, because the parent bus node defines that interface, e.g. "vendor,device" instead of "vendor,device-i2c" + "vendor,device-spi". 2. If the compatible represents the device as a whole, it should not contain the type of device in the name. 3. Filenames should match compatible. The best if match is 100%, but if binding has multiple compatibles, then one of the fallbacks should be used. Alternatively a genericish name is allowed if it follows "vendor,device" style. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring (Arm) <[email protected]>
1 parent 651fcd2 commit a1d87a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Documentation/devicetree/bindings/writing-bindings.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Properties
5252
fallback if appropriate. SoC-specific compatibles are also preferred for
5353
the fallbacks.
5454

55+
- DON'T use bus suffixes to encode the type of interface device is using.
56+
The parent bus node already implies that interface. DON'T add the type of
57+
device, if the device cannot be anything else.
58+
5559
- DO use a vendor prefix on device-specific property names. Consider if
5660
properties could be common among devices of the same class. Check other
5761
existing bindings for similar devices.
@@ -101,6 +105,10 @@ Typical cases and caveats
101105
- "syscon" is not a generic property. Use vendor and type, e.g.
102106
"vendor,power-manager-syscon".
103107

108+
- Bindings files should be named like compatible: vendor,device.yaml. In case
109+
of multiple compatibles in the binding, use one of the fallbacks or a more
110+
generic name, yet still matching compatible style.
111+
104112
Board/SoC .dts Files
105113
====================
106114

0 commit comments

Comments
 (0)