All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] docs: dt: writing-bindings: describe typical cases
@ 2022-04-03  8:18 Krzysztof Kozlowski
  2022-04-03  8:18 ` [PATCH 2/2] docs: dt: writing-schema: mention coding style Krzysztof Kozlowski
  2022-04-04 22:51 ` [PATCH 1/2] docs: dt: writing-bindings: describe typical cases Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-03  8:18 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel,
	Jonathan Corbet, linux-doc
  Cc: Krzysztof Kozlowski

Add a chapter for caveats or typical mistakes.  Source: Rob Herring's
(Devicetree bindings maintainer) comments on LKML.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/writing-bindings.rst  | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/devicetree/bindings/writing-bindings.rst b/Documentation/devicetree/bindings/writing-bindings.rst
index 18d9e0689d49..5465eced2af1 100644
--- a/Documentation/devicetree/bindings/writing-bindings.rst
+++ b/Documentation/devicetree/bindings/writing-bindings.rst
@@ -58,6 +58,31 @@ Properties
 - DO define properties in terms of constraints. How many entries? What are
   possible values? What is the order?
 
+Typical cases and caveats
+=========================
+
+- Phandle entries, like clocks/dmas/interrupts/resets, should always be
+  explicitly ordered. Include the {clock,dma,interrupt,reset}-names if there is
+  more than one phandle. When used, both of these fields need the same
+  constraints (e.g.  list of items).
+
+- For names used in {clock,dma,interrupt,reset}-names, do not add any suffix,
+  e.g.: "tx" instead of "txirq" (for interrupt).
+
+- Properties without schema types (e.g. without standard suffix or not defined
+  by schema) need the type, even if this is an enum.
+
+- If schema includes other schema (e.g. /schemas/i2c/i2c-controller.yaml) use
+  "unevaluatedProperties:false". In other cases, usually use
+  "additionalProperties:false".
+
+- For sub-blocks/components of bigger device (e.g. SoC blocks) use rather
+  device-based compatible (e.g. SoC-based compatible), instead of custom
+  versioning of that component.
+  For example use "vendor,soc1234-i2c" instead of "vendor,i2c-v2".
+
+- "syscon" is not a generic property. Use vendor and type, e.g.
+  "vendor,power-manager-syscon".
 
 Board/SoC .dts Files
 ====================
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-04 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-03  8:18 [PATCH 1/2] docs: dt: writing-bindings: describe typical cases Krzysztof Kozlowski
2022-04-03  8:18 ` [PATCH 2/2] docs: dt: writing-schema: mention coding style Krzysztof Kozlowski
2022-04-04 22:52   ` Rob Herring
2022-04-04 22:51 ` [PATCH 1/2] docs: dt: writing-bindings: describe typical cases Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.