1c66ec88fSEmmanuel Vadot.. SPDX-License-Identifier: GPL-2.0 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel Vadot========================================== 42eb4d8dcSEmmanuel VadotSubmitting Devicetree (DT) binding patches 5c66ec88fSEmmanuel Vadot========================================== 6c66ec88fSEmmanuel Vadot 7c66ec88fSEmmanuel VadotI. For patch submitters 8c66ec88fSEmmanuel Vadot======================= 9c66ec88fSEmmanuel Vadot 105956d97fSEmmanuel Vadot 0) Normal patch submission rules from 115956d97fSEmmanuel Vadot Documentation/process/submitting-patches.rst applies. 12c66ec88fSEmmanuel Vadot 13c66ec88fSEmmanuel Vadot 1) The Documentation/ and include/dt-bindings/ portion of the patch should 14c66ec88fSEmmanuel Vadot be a separate patch. The preferred subject prefix for binding patches is:: 15c66ec88fSEmmanuel Vadot 16c66ec88fSEmmanuel Vadot "dt-bindings: <binding dir>: ..." 17c66ec88fSEmmanuel Vadot 18*01950c46SEmmanuel Vadot Few subsystems, like ASoC, media, regulators and SPI, expect reverse order 19*01950c46SEmmanuel Vadot of the prefixes:: 20*01950c46SEmmanuel Vadot 21*01950c46SEmmanuel Vadot "<binding dir>: dt-bindings: ..." 22*01950c46SEmmanuel Vadot 23c66ec88fSEmmanuel Vadot The 80 characters of the subject are precious. It is recommended to not 24c66ec88fSEmmanuel Vadot use "Documentation" or "doc" because that is implied. All bindings are 25c66ec88fSEmmanuel Vadot docs. Repeating "binding" again should also be avoided. 26c66ec88fSEmmanuel Vadot 27c66ec88fSEmmanuel Vadot 2) DT binding files are written in DT schema format using json-schema 28c66ec88fSEmmanuel Vadot vocabulary and YAML file format. The DT binding files must pass validation 29c66ec88fSEmmanuel Vadot by running:: 30c66ec88fSEmmanuel Vadot 31c66ec88fSEmmanuel Vadot make dt_binding_check 32c66ec88fSEmmanuel Vadot 335956d97fSEmmanuel Vadot See Documentation/devicetree/bindings/writing-schema.rst for more details 345956d97fSEmmanuel Vadot about schema and tools setup. 35c66ec88fSEmmanuel Vadot 36c66ec88fSEmmanuel Vadot 3) DT binding files should be dual licensed. The preferred license tag is 37c66ec88fSEmmanuel Vadot (GPL-2.0-only OR BSD-2-Clause). 38c66ec88fSEmmanuel Vadot 39c66ec88fSEmmanuel Vadot 4) Submit the entire series to the devicetree mailinglist at 40c66ec88fSEmmanuel Vadot 41c66ec88fSEmmanuel Vadot devicetree@vger.kernel.org 42c66ec88fSEmmanuel Vadot 43c66ec88fSEmmanuel Vadot and Cc: the DT maintainers. Use scripts/get_maintainer.pl to identify 44c66ec88fSEmmanuel Vadot all of the DT maintainers. 45c66ec88fSEmmanuel Vadot 46c66ec88fSEmmanuel Vadot 5) The Documentation/ portion of the patch should come in the series before 47c66ec88fSEmmanuel Vadot the code implementing the binding. 48c66ec88fSEmmanuel Vadot 49c66ec88fSEmmanuel Vadot 6) Any compatible strings used in a chip or board DTS file must be 50*01950c46SEmmanuel Vadot previously documented in the corresponding DT binding file 51c66ec88fSEmmanuel Vadot in Documentation/devicetree/bindings. This rule applies even if 52c66ec88fSEmmanuel Vadot the Linux device driver does not yet match on the compatible 53c66ec88fSEmmanuel Vadot string. [ checkpatch will emit warnings if this step is not 54c66ec88fSEmmanuel Vadot followed as of commit bff5da4335256513497cc8c79f9a9d1665e09864 55c66ec88fSEmmanuel Vadot ("checkpatch: add DT compatible string documentation checks"). ] 56c66ec88fSEmmanuel Vadot 57*01950c46SEmmanuel Vadot 7) If a documented compatible string is not yet matched by the 58c66ec88fSEmmanuel Vadot driver, the documentation should also include a compatible 59*01950c46SEmmanuel Vadot string that is matched by the driver. 60c66ec88fSEmmanuel Vadot 61*01950c46SEmmanuel Vadot 8) Bindings are actively used by multiple projects other than the Linux 628cc087a1SEmmanuel Vadot Kernel, extra care and consideration may need to be taken when making changes 638cc087a1SEmmanuel Vadot to existing bindings. 64c66ec88fSEmmanuel Vadot 65c66ec88fSEmmanuel VadotII. For kernel maintainers 66c66ec88fSEmmanuel Vadot========================== 67c66ec88fSEmmanuel Vadot 68c66ec88fSEmmanuel Vadot 1) If you aren't comfortable reviewing a given binding, reply to it and ask 69c66ec88fSEmmanuel Vadot the devicetree maintainers for guidance. This will help them prioritize 70c66ec88fSEmmanuel Vadot which ones to review and which ones are ok to let go. 71c66ec88fSEmmanuel Vadot 72c66ec88fSEmmanuel Vadot 2) For driver (not subsystem) bindings: If you are comfortable with the 73c66ec88fSEmmanuel Vadot binding, and it hasn't received an Acked-by from the devicetree 74c66ec88fSEmmanuel Vadot maintainers after a few weeks, go ahead and take it. 75c66ec88fSEmmanuel Vadot 762eb4d8dcSEmmanuel Vadot For subsystem bindings (anything affecting more than a single device), 772eb4d8dcSEmmanuel Vadot getting a devicetree maintainer to review it is required. 78c66ec88fSEmmanuel Vadot 79c66ec88fSEmmanuel Vadot 3) For a series going though multiple trees, the binding patch should be 80c66ec88fSEmmanuel Vadot kept with the driver using the binding. 81c66ec88fSEmmanuel Vadot 82c66ec88fSEmmanuel VadotIII. Notes 83c66ec88fSEmmanuel Vadot========== 84c66ec88fSEmmanuel Vadot 855956d97fSEmmanuel Vadot 0) Please see Documentation/devicetree/bindings/ABI.rst for details 865956d97fSEmmanuel Vadot regarding devicetree ABI. 87c66ec88fSEmmanuel Vadot 88c66ec88fSEmmanuel Vadot 1) This document is intended as a general familiarization with the process as 89c66ec88fSEmmanuel Vadot decided at the 2013 Kernel Summit. When in doubt, the current word of the 90c66ec88fSEmmanuel Vadot devicetree maintainers overrules this document. In that situation, a patch 91c66ec88fSEmmanuel Vadot updating this document would be appreciated. 92