1858e6845SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0 22a933001SJason Cooper 3858e6845SMauro Carvalho Chehab========================================== 47248213cSRob HerringSubmitting Devicetree (DT) binding patches 5858e6845SMauro Carvalho Chehab========================================== 62a933001SJason Cooper 72a933001SJason CooperI. For patch submitters 8858e6845SMauro Carvalho Chehab======================= 92a933001SJason Cooper 106dce82b2SMauro Carvalho Chehab 0) Normal patch submission rules from 116dce82b2SMauro Carvalho Chehab Documentation/process/submitting-patches.rst applies. 122a933001SJason Cooper 1344acf105SRob Herring 1) The Documentation/ and include/dt-bindings/ portion of the patch should 14858e6845SMauro Carvalho Chehab be a separate patch. The preferred subject prefix for binding patches is:: 1544acf105SRob Herring 1644acf105SRob Herring "dt-bindings: <binding dir>: ..." 1744acf105SRob Herring 1844acf105SRob Herring The 80 characters of the subject are precious. It is recommended to not 1944acf105SRob Herring use "Documentation" or "doc" because that is implied. All bindings are 2044acf105SRob Herring docs. Repeating "binding" again should also be avoided. 212a933001SJason Cooper 2270145d16SRob Herring 2) DT binding files are written in DT schema format using json-schema 2370145d16SRob Herring vocabulary and YAML file format. The DT binding files must pass validation 24858e6845SMauro Carvalho Chehab by running:: 2570145d16SRob Herring 2670145d16SRob Herring make dt_binding_check 2770145d16SRob Herring 286dce82b2SMauro Carvalho Chehab See Documentation/devicetree/bindings/writing-schema.rst for more details 296dce82b2SMauro Carvalho Chehab about schema and tools setup. 3070145d16SRob Herring 3170145d16SRob Herring 3) DT binding files should be dual licensed. The preferred license tag is 3270145d16SRob Herring (GPL-2.0-only OR BSD-2-Clause). 3370145d16SRob Herring 3470145d16SRob Herring 4) Submit the entire series to the devicetree mailinglist at 352a933001SJason Cooper 362a933001SJason Cooper devicetree@vger.kernel.org 372a933001SJason Cooper 38d1e9fa98SMatt Porter and Cc: the DT maintainers. Use scripts/get_maintainer.pl to identify 39d1e9fa98SMatt Porter all of the DT maintainers. 40d1e9fa98SMatt Porter 4170145d16SRob Herring 5) The Documentation/ portion of the patch should come in the series before 42ef0b97e3SJavier Martinez Canillas the code implementing the binding. 43ef0b97e3SJavier Martinez Canillas 4470145d16SRob Herring 6) Any compatible strings used in a chip or board DTS file must be 4510638a4eSPaul Walmsley previously documented in the corresponding DT binding text file 4610638a4eSPaul Walmsley in Documentation/devicetree/bindings. This rule applies even if 4710638a4eSPaul Walmsley the Linux device driver does not yet match on the compatible 4810638a4eSPaul Walmsley string. [ checkpatch will emit warnings if this step is not 4910638a4eSPaul Walmsley followed as of commit bff5da4335256513497cc8c79f9a9d1665e09864 5010638a4eSPaul Walmsley ("checkpatch: add DT compatible string documentation checks"). ] 5110638a4eSPaul Walmsley 5270145d16SRob Herring 7) The wildcard "<chip>" may be used in compatible strings, as in 5310638a4eSPaul Walmsley the following example: 5410638a4eSPaul Walmsley 5510638a4eSPaul Walmsley - compatible: Must contain '"nvidia,<chip>-pcie", 5610638a4eSPaul Walmsley "nvidia,tegra20-pcie"' where <chip> is tegra30, tegra132, ... 5710638a4eSPaul Walmsley 5810638a4eSPaul Walmsley As in the above example, the known values of "<chip>" should be 5910638a4eSPaul Walmsley documented if it is used. 6010638a4eSPaul Walmsley 6170145d16SRob Herring 8) If a documented compatible string is not yet matched by the 6210638a4eSPaul Walmsley driver, the documentation should also include a compatible 6310638a4eSPaul Walmsley string that is matched by the driver (as in the "nvidia,tegra20-pcie" 6410638a4eSPaul Walmsley example above). 6510638a4eSPaul Walmsley 66c9dcc63eSTom Rini 9) Bindings are actively used by multiple projects other than the Linux 67c9dcc63eSTom Rini Kernel, extra care and consideration may need to be taken when making changes 68c9dcc63eSTom Rini to existing bindings. 6910638a4eSPaul Walmsley 702a933001SJason CooperII. For kernel maintainers 71858e6845SMauro Carvalho Chehab========================== 722a933001SJason Cooper 732a933001SJason Cooper 1) If you aren't comfortable reviewing a given binding, reply to it and ask 742a933001SJason Cooper the devicetree maintainers for guidance. This will help them prioritize 752a933001SJason Cooper which ones to review and which ones are ok to let go. 762a933001SJason Cooper 772a933001SJason Cooper 2) For driver (not subsystem) bindings: If you are comfortable with the 782a933001SJason Cooper binding, and it hasn't received an Acked-by from the devicetree 792a933001SJason Cooper maintainers after a few weeks, go ahead and take it. 802a933001SJason Cooper 81e3c2b1edSGeert Uytterhoeven For subsystem bindings (anything affecting more than a single device), 82e3c2b1edSGeert Uytterhoeven getting a devicetree maintainer to review it is required. 832a933001SJason Cooper 842a933001SJason Cooper 3) For a series going though multiple trees, the binding patch should be 852a933001SJason Cooper kept with the driver using the binding. 862a933001SJason Cooper 872a933001SJason CooperIII. Notes 88858e6845SMauro Carvalho Chehab========== 892a933001SJason Cooper 906dce82b2SMauro Carvalho Chehab 0) Please see Documentation/devicetree/bindings/ABI.rst for details 916dce82b2SMauro Carvalho Chehab regarding devicetree ABI. 922a933001SJason Cooper 932a933001SJason Cooper 1) This document is intended as a general familiarization with the process as 942a933001SJason Cooper decided at the 2013 Kernel Summit. When in doubt, the current word of the 952a933001SJason Cooper devicetree maintainers overrules this document. In that situation, a patch 962a933001SJason Cooper updating this document would be appreciated. 97