Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 2 | |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 3 | ========================================== |
| 4 | Submitting devicetree (DT) binding patches |
| 5 | ========================================== |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 6 | |
| 7 | I. For patch submitters |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 8 | ======================= |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 9 | |
Mauro Carvalho Chehab | 8c27ceff3 | 2016-10-18 10:12:27 -0200 | [diff] [blame] | 10 | 0) Normal patch submission rules from Documentation/process/submitting-patches.rst |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 11 | applies. |
| 12 | |
Rob Herring | 44acf10 | 2018-06-05 16:37:47 -0600 | [diff] [blame] | 13 | 1) The Documentation/ and include/dt-bindings/ portion of the patch should |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 14 | be a separate patch. The preferred subject prefix for binding patches is:: |
Rob Herring | 44acf10 | 2018-06-05 16:37:47 -0600 | [diff] [blame] | 15 | |
| 16 | "dt-bindings: <binding dir>: ..." |
| 17 | |
| 18 | The 80 characters of the subject are precious. It is recommended to not |
| 19 | use "Documentation" or "doc" because that is implied. All bindings are |
| 20 | docs. Repeating "binding" again should also be avoided. |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 21 | |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 22 | 2) DT binding files are written in DT schema format using json-schema |
| 23 | vocabulary and YAML file format. The DT binding files must pass validation |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 24 | by running:: |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 25 | |
| 26 | make dt_binding_check |
| 27 | |
| 28 | See ../writing-schema.rst for more details about schema and tools setup. |
| 29 | |
| 30 | 3) DT binding files should be dual licensed. The preferred license tag is |
| 31 | (GPL-2.0-only OR BSD-2-Clause). |
| 32 | |
| 33 | 4) Submit the entire series to the devicetree mailinglist at |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 34 | |
| 35 | devicetree@vger.kernel.org |
| 36 | |
Matt Porter | d1e9fa9 | 2015-03-05 10:53:11 -0500 | [diff] [blame] | 37 | and Cc: the DT maintainers. Use scripts/get_maintainer.pl to identify |
| 38 | all of the DT maintainers. |
| 39 | |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 40 | 5) The Documentation/ portion of the patch should come in the series before |
Javier Martinez Canillas | ef0b97e | 2014-10-09 20:24:07 +0200 | [diff] [blame] | 41 | the code implementing the binding. |
| 42 | |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 43 | 6) Any compatible strings used in a chip or board DTS file must be |
Paul Walmsley | 10638a4 | 2015-01-30 15:11:04 -0700 | [diff] [blame] | 44 | previously documented in the corresponding DT binding text file |
| 45 | in Documentation/devicetree/bindings. This rule applies even if |
| 46 | the Linux device driver does not yet match on the compatible |
| 47 | string. [ checkpatch will emit warnings if this step is not |
| 48 | followed as of commit bff5da4335256513497cc8c79f9a9d1665e09864 |
| 49 | ("checkpatch: add DT compatible string documentation checks"). ] |
| 50 | |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 51 | 7) The wildcard "<chip>" may be used in compatible strings, as in |
Paul Walmsley | 10638a4 | 2015-01-30 15:11:04 -0700 | [diff] [blame] | 52 | the following example: |
| 53 | |
| 54 | - compatible: Must contain '"nvidia,<chip>-pcie", |
| 55 | "nvidia,tegra20-pcie"' where <chip> is tegra30, tegra132, ... |
| 56 | |
| 57 | As in the above example, the known values of "<chip>" should be |
| 58 | documented if it is used. |
| 59 | |
Rob Herring | 70145d1 | 2019-10-15 10:47:49 -0500 | [diff] [blame] | 60 | 8) If a documented compatible string is not yet matched by the |
Paul Walmsley | 10638a4 | 2015-01-30 15:11:04 -0700 | [diff] [blame] | 61 | driver, the documentation should also include a compatible |
| 62 | string that is matched by the driver (as in the "nvidia,tegra20-pcie" |
| 63 | example above). |
| 64 | |
| 65 | |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 66 | II. For kernel maintainers |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 67 | ========================== |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 68 | |
| 69 | 1) If you aren't comfortable reviewing a given binding, reply to it and ask |
| 70 | the devicetree maintainers for guidance. This will help them prioritize |
| 71 | which ones to review and which ones are ok to let go. |
| 72 | |
| 73 | 2) For driver (not subsystem) bindings: If you are comfortable with the |
| 74 | binding, and it hasn't received an Acked-by from the devicetree |
| 75 | maintainers after a few weeks, go ahead and take it. |
| 76 | |
| 77 | Subsystem bindings (anything affecting more than a single device) |
| 78 | then getting a devicetree maintainer to review it is required. |
| 79 | |
| 80 | 3) For a series going though multiple trees, the binding patch should be |
| 81 | kept with the driver using the binding. |
| 82 | |
| 83 | III. Notes |
Mauro Carvalho Chehab | 858e684 | 2020-04-15 16:45:25 +0200 | [diff] [blame] | 84 | ========== |
Jason Cooper | 2a93300 | 2013-12-17 16:59:40 +0000 | [diff] [blame] | 85 | |
| 86 | 0) Please see ...bindings/ABI.txt for details regarding devicetree ABI. |
| 87 | |
| 88 | 1) This document is intended as a general familiarization with the process as |
| 89 | decided at the 2013 Kernel Summit. When in doubt, the current word of the |
| 90 | devicetree maintainers overrules this document. In that situation, a patch |
| 91 | updating this document would be appreciated. |