Commit e62fc182 authored by Rob Herring's avatar Rob Herring

dt-bindings: Add missing (unevaluated|additional)Properties on child node schemas

Just as unevaluatedProperties or additionalProperties are required at
the top level of schemas, they should (and will) also be required for
child node schemas. That ensures only documented properties are
present.

Add unevaluatedProperties or additionalProperties as appropriate, and
then add any missing properties flagged by the addition.
Acked-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarLee Jones <lee@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230124230228.372305-1-robh@kernel.orgSigned-off-by: default avatarRob Herring <robh@kernel.org>
parent 5eac0bdc
...@@ -144,6 +144,7 @@ patternProperties: ...@@ -144,6 +144,7 @@ patternProperties:
it is stricter and always has two compatibles. it is stricter and always has two compatibles.
type: object type: object
$ref: '/schemas/simple-bus.yaml' $ref: '/schemas/simple-bus.yaml'
unevaluatedProperties: false
properties: properties:
compatible: compatible:
......
...@@ -30,6 +30,7 @@ properties: ...@@ -30,6 +30,7 @@ properties:
clocks: clocks:
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
...@@ -47,6 +48,7 @@ properties: ...@@ -47,6 +48,7 @@ properties:
reset: reset:
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
...@@ -63,6 +65,7 @@ properties: ...@@ -63,6 +65,7 @@ properties:
pwm: pwm:
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
...@@ -76,8 +79,6 @@ properties: ...@@ -76,8 +79,6 @@ properties:
- compatible - compatible
- "#pwm-cells" - "#pwm-cells"
additionalProperties: false
required: required:
- compatible - compatible
- mboxes - mboxes
......
...@@ -234,6 +234,7 @@ properties: ...@@ -234,6 +234,7 @@ properties:
patternProperties: patternProperties:
"^[a-z0-9]+$": "^[a-z0-9]+$":
type: object type: object
additionalProperties: false
properties: properties:
clocks: clocks:
...@@ -252,6 +253,9 @@ properties: ...@@ -252,6 +253,9 @@ properties:
for controlling a power-gate. for controlling a power-gate.
See ../reset/reset.txt for more details. See ../reset/reset.txt for more details.
power-domains:
maxItems: 1
'#power-domain-cells': '#power-domain-cells':
const: 0 const: 0
description: Must be 0. description: Must be 0.
......
...@@ -46,6 +46,7 @@ patternProperties: ...@@ -46,6 +46,7 @@ patternProperties:
# All other properties should be child nodes with unit-address and 'reg' # All other properties should be child nodes with unit-address and 'reg'
"^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$": "^[a-zA-Z][a-zA-Z0-9,+\\-._]{0,63}@[0-9a-fA-F]+$":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -45,6 +45,7 @@ properties: ...@@ -45,6 +45,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-9a-fA-F]+$": "^.*@[0-9a-fA-F]+$":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -36,6 +36,7 @@ patternProperties: ...@@ -36,6 +36,7 @@ patternProperties:
# All other properties should be child nodes with unit-address and 'reg' # All other properties should be child nodes with unit-address and 'reg'
"@[0-9a-f]+$": "@[0-9a-f]+$":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
......
...@@ -101,6 +101,7 @@ required: ...@@ -101,6 +101,7 @@ required:
patternProperties: patternProperties:
"^display-controller@[1-9a-f][0-9a-f]*$": "^display-controller@[1-9a-f][0-9a-f]*$":
type: object type: object
additionalProperties: true
properties: properties:
compatible: compatible:
contains: contains:
...@@ -108,6 +109,7 @@ patternProperties: ...@@ -108,6 +109,7 @@ patternProperties:
"^dsi@[1-9a-f][0-9a-f]*$": "^dsi@[1-9a-f][0-9a-f]*$":
type: object type: object
additionalProperties: true
properties: properties:
compatible: compatible:
contains: contains:
...@@ -115,6 +117,7 @@ patternProperties: ...@@ -115,6 +117,7 @@ patternProperties:
"^phy@[1-9a-f][0-9a-f]*$": "^phy@[1-9a-f][0-9a-f]*$":
type: object type: object
additionalProperties: true
properties: properties:
compatible: compatible:
enum: enum:
...@@ -132,6 +135,7 @@ patternProperties: ...@@ -132,6 +135,7 @@ patternProperties:
"^hdmi-tx@[1-9a-f][0-9a-f]*$": "^hdmi-tx@[1-9a-f][0-9a-f]*$":
type: object type: object
additionalProperties: true
properties: properties:
compatible: compatible:
enum: enum:
......
...@@ -176,6 +176,8 @@ properties: ...@@ -176,6 +176,8 @@ properties:
description: Child nodes are just another property from a json-schema description: Child nodes are just another property from a json-schema
perspective. perspective.
type: object # DT nodes are json objects type: object # DT nodes are json objects
# Child nodes also need additionalProperties or unevaluatedProperties
additionalProperties: false
properties: properties:
vendor,a-child-node-property: vendor,a-child-node-property:
description: Child node properties have all the same schema description: Child node properties have all the same schema
......
...@@ -35,6 +35,7 @@ properties: ...@@ -35,6 +35,7 @@ properties:
patternProperties: patternProperties:
"^.*-pins?$": "^.*-pins?$":
$ref: /schemas/pinctrl/pinmux-node.yaml# $ref: /schemas/pinctrl/pinmux-node.yaml#
additionalProperties: false
properties: properties:
pins: pins:
......
...@@ -32,6 +32,7 @@ properties: ...@@ -32,6 +32,7 @@ properties:
patternProperties: patternProperties:
"^channel@([0-1])$": "^channel@([0-1])$":
type: object type: object
additionalProperties: false
description: | description: |
Represents the two supplies to be monitored. Represents the two supplies to be monitored.
......
...@@ -66,6 +66,7 @@ properties: ...@@ -66,6 +66,7 @@ properties:
patternProperties: patternProperties:
'^interconnect-[a-z0-9]+$': '^interconnect-[a-z0-9]+$':
type: object type: object
additionalProperties: false
description: description:
snoc-mm is a child of snoc, sharing snoc's register address space. snoc-mm is a child of snoc, sharing snoc's register address space.
......
...@@ -133,12 +133,14 @@ properties: ...@@ -133,12 +133,14 @@ properties:
ppi-partitions: ppi-partitions:
type: object type: object
additionalProperties: false
description: description:
PPI affinity can be expressed as a single "ppi-partitions" node, PPI affinity can be expressed as a single "ppi-partitions" node,
containing a set of sub-nodes. containing a set of sub-nodes.
patternProperties: patternProperties:
"^interrupt-partition-[0-9]+$": "^interrupt-partition-[0-9]+$":
type: object type: object
additionalProperties: false
properties: properties:
affinity: affinity:
$ref: /schemas/types.yaml#/definitions/phandle-array $ref: /schemas/types.yaml#/definitions/phandle-array
......
...@@ -72,6 +72,7 @@ patternProperties: ...@@ -72,6 +72,7 @@ patternProperties:
'^mailbox@[0-9a-f]+$': '^mailbox@[0-9a-f]+$':
description: Internal ipi mailbox node description: Internal ipi mailbox node
type: object # DT nodes are json objects type: object # DT nodes are json objects
additionalProperties: false
properties: properties:
xlnx,ipi-id: xlnx,ipi-id:
description: description:
......
...@@ -156,6 +156,7 @@ properties: ...@@ -156,6 +156,7 @@ properties:
patternProperties: patternProperties:
"^i2c@[0-3]$": "^i2c@[0-3]$":
type: object type: object
additionalProperties: false
description: | description: |
Child node of the i2c bus multiplexer which represents a GMSL link. Child node of the i2c bus multiplexer which represents a GMSL link.
Each serializer device on the GMSL link remote end is represented with Each serializer device on the GMSL link remote end is represented with
...@@ -167,6 +168,12 @@ properties: ...@@ -167,6 +168,12 @@ properties:
description: The index of the GMSL channel. description: The index of the GMSL channel.
maxItems: 1 maxItems: 1
'#address-cells':
const: 1
'#size-cells':
const: 0
patternProperties: patternProperties:
"^camera@[a-f0-9]+$": "^camera@[a-f0-9]+$":
type: object type: object
......
...@@ -73,6 +73,7 @@ properties: ...@@ -73,6 +73,7 @@ properties:
patternProperties: patternProperties:
"@[0-7],[a-f0-9]+$": "@[0-7],[a-f0-9]+$":
type: object type: object
additionalProperties: true
description: | description: |
The child device node represents the controller connected to the SMC The child device node represents the controller connected to the SMC
bus. The controller can be a NAND controller or a pair of any memory bus. The controller can be a NAND controller or a pair of any memory
......
...@@ -38,6 +38,7 @@ properties: ...@@ -38,6 +38,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-3],[a-f0-9]+$": "^.*@[0-3],[a-f0-9]+$":
type: object type: object
additionalProperties: true
description: description:
The actual device nodes should be added as subnodes to the SROMc node. The actual device nodes should be added as subnodes to the SROMc node.
These subnodes, in addition to regular device specification, should These subnodes, in addition to regular device specification, should
......
...@@ -57,6 +57,7 @@ patternProperties: ...@@ -57,6 +57,7 @@ patternProperties:
subnodes. subnodes.
type: object type: object
$ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml# $ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#
additionalProperties: true
required: required:
- compatible - compatible
......
...@@ -50,6 +50,7 @@ properties: ...@@ -50,6 +50,7 @@ properties:
patternProperties: patternProperties:
"^emc-timings-[0-9]+$": "^emc-timings-[0-9]+$":
type: object type: object
additionalProperties: false
properties: properties:
nvidia,ram-code: nvidia,ram-code:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
......
...@@ -47,6 +47,7 @@ properties: ...@@ -47,6 +47,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-4],[a-f0-9]+$": "^.*@[0-4],[a-f0-9]+$":
additionalProperties: true
type: object type: object
$ref: mc-peripheral-props.yaml# $ref: mc-peripheral-props.yaml#
......
...@@ -46,6 +46,7 @@ properties: ...@@ -46,6 +46,7 @@ properties:
rtc: rtc:
type: object type: object
$ref: /schemas/rtc/rtc.yaml# $ref: /schemas/rtc/rtc.yaml#
unevaluatedProperties: false
description: description:
MT6357 Real Time Clock. MT6357 Real Time Clock.
properties: properties:
......
...@@ -35,6 +35,7 @@ properties: ...@@ -35,6 +35,7 @@ properties:
adc: adc:
type: object type: object
additionalProperties: false
description: | description: |
Provides 9 channels for system monitoring, including VBUSDIV5 (lower Provides 9 channels for system monitoring, including VBUSDIV5 (lower
accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
...@@ -73,6 +74,7 @@ properties: ...@@ -73,6 +74,7 @@ properties:
regulators: regulators:
type: object type: object
additionalProperties: false
description: | description: |
List all supported regulators, which support the control for DisplayBias List all supported regulators, which support the control for DisplayBias
voltages and one general purpose LDO which commonly used to drive the voltages and one general purpose LDO which commonly used to drive the
......
...@@ -42,6 +42,7 @@ patternProperties: ...@@ -42,6 +42,7 @@ patternProperties:
"^sdhci@[0-9a-f]+$": "^sdhci@[0-9a-f]+$":
type: object type: object
$ref: mmc-controller.yaml $ref: mmc-controller.yaml
unevaluatedProperties: false
properties: properties:
compatible: compatible:
......
...@@ -44,6 +44,7 @@ patternProperties: ...@@ -44,6 +44,7 @@ patternProperties:
"^otp(-[0-9]+)?$": "^otp(-[0-9]+)?$":
$ref: ../nvmem/nvmem.yaml# $ref: ../nvmem/nvmem.yaml#
unevaluatedProperties: false
description: | description: |
An OTP memory region. Some flashes provide a one-time-programmable An OTP memory region. Some flashes provide a one-time-programmable
......
...@@ -28,6 +28,7 @@ properties: ...@@ -28,6 +28,7 @@ properties:
patternProperties: patternProperties:
'^(ac|usb)$': '^(ac|usb)$':
type: object type: object
additionalProperties: false
description: USB/AC charging parameters description: USB/AC charging parameters
properties: properties:
charger-type: charger-type:
......
...@@ -157,6 +157,7 @@ properties: ...@@ -157,6 +157,7 @@ properties:
mba: mba:
type: object type: object
additionalProperties: false
description: description:
MBA reserved region (prefer using memory-region with two items) MBA reserved region (prefer using memory-region with two items)
properties: properties:
...@@ -167,6 +168,7 @@ properties: ...@@ -167,6 +168,7 @@ properties:
mpss: mpss:
type: object type: object
additionalProperties: false
description: description:
MPSS reserved region (prefer using memory-region with two items) MPSS reserved region (prefer using memory-region with two items)
properties: properties:
......
...@@ -38,8 +38,9 @@ properties: ...@@ -38,8 +38,9 @@ properties:
patternProperties: patternProperties:
"power-domain@[0-9a-f]+$": "power-domain@[0-9a-f]+$":
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
items: items:
......
...@@ -54,6 +54,7 @@ patternProperties: ...@@ -54,6 +54,7 @@ patternProperties:
"^timer@[0-2]$": "^timer@[0-2]$":
description: The timer block channels that are used as timers or counters. description: The timer block channels that are used as timers or counters.
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
items: items:
......
...@@ -130,6 +130,7 @@ patternProperties: ...@@ -130,6 +130,7 @@ patternProperties:
PRU-ICSS configuration space. CFG sub-module represented as a SysCon. PRU-ICSS configuration space. CFG sub-module represented as a SysCon.
type: object type: object
additionalProperties: false
properties: properties:
compatible: compatible:
......
...@@ -60,6 +60,7 @@ properties: ...@@ -60,6 +60,7 @@ properties:
properties: properties:
endpoint: endpoint:
type: object type: object
additionalProperties: true
properties: properties:
dai-format: dai-format:
......
...@@ -134,6 +134,7 @@ properties: ...@@ -134,6 +134,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-9a-f]+$": "^.*@[0-9a-f]+$":
type: object type: object
additionalProperties: true
description: | description: |
WCD934x subnode for each slave devices. Bindings of each subnodes WCD934x subnode for each slave devices. Bindings of each subnodes
depends on the specific driver providing the functionality and depends on the specific driver providing the functionality and
......
...@@ -35,12 +35,14 @@ properties: ...@@ -35,12 +35,14 @@ properties:
cpu: cpu:
type: object type: object
additionalProperties: false
properties: properties:
sound-dai: sound-dai:
description: phandles to the I2S controllers description: phandles to the I2S controllers
codec: codec:
type: object type: object
additionalProperties: false
properties: properties:
sound-dai: sound-dai:
minItems: 1 minItems: 1
......
...@@ -200,6 +200,7 @@ properties: ...@@ -200,6 +200,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-9a-f],[0-9a-f]$": "^.*@[0-9a-f],[0-9a-f]$":
type: object type: object
additionalProperties: true
description: description:
Child nodes for a standalone audio codec or speaker amplifier IC. Child nodes for a standalone audio codec or speaker amplifier IC.
It has RX and TX Soundwire secondary devices. It has RX and TX Soundwire secondary devices.
......
...@@ -51,6 +51,7 @@ properties: ...@@ -51,6 +51,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-9a-f]+": "^.*@[0-9a-f]+":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
items: items:
......
...@@ -63,6 +63,7 @@ properties: ...@@ -63,6 +63,7 @@ properties:
patternProperties: patternProperties:
"^.*@[0-9a-f]+": "^.*@[0-9a-f]+":
type: object type: object
additionalProperties: true
properties: properties:
reg: reg:
items: items:
......
...@@ -94,6 +94,7 @@ patternProperties: ...@@ -94,6 +94,7 @@ patternProperties:
"^.*@[0-9a-f]+$": "^.*@[0-9a-f]+$":
type: object type: object
$ref: spi-peripheral-props.yaml $ref: spi-peripheral-props.yaml
additionalProperties: true
properties: properties:
spi-3wire: spi-3wire:
......
...@@ -57,17 +57,17 @@ properties: ...@@ -57,17 +57,17 @@ properties:
patternProperties: patternProperties:
"^sram@[a-z0-9]+": "^sram@[a-z0-9]+":
type: object $ref: /schemas/sram/sram.yaml#
unevaluatedProperties: false
properties:
compatible:
const: mmio-sram
patternProperties: patternProperties:
"^sram-section?@[a-f0-9]+$": "^sram-section?@[a-f0-9]+$":
type: object type: object
additionalProperties: false
properties: properties:
reg: true
compatible: compatible:
oneOf: oneOf:
- const: allwinner,sun4i-a10-sram-a3-a4 - const: allwinner,sun4i-a10-sram-a3-a4
......
...@@ -61,6 +61,7 @@ additionalProperties: false ...@@ -61,6 +61,7 @@ additionalProperties: false
patternProperties: patternProperties:
"-sram@[0-9a-f]+$": "-sram@[0-9a-f]+$":
type: object type: object
additionalProperties: false
description: A region of reserved memory. description: A region of reserved memory.
properties: properties:
......
...@@ -171,6 +171,7 @@ patternProperties: ...@@ -171,6 +171,7 @@ patternProperties:
cooling-maps: cooling-maps:
type: object type: object
additionalProperties: false
description: description:
This node describes the action to be taken when a thermal zone This node describes the action to be taken when a thermal zone
crosses one of the temperature thresholds described in the trips crosses one of the temperature thresholds described in the trips
......
...@@ -121,6 +121,7 @@ properties: ...@@ -121,6 +121,7 @@ properties:
patternProperties: patternProperties:
"^usb@[0-9a-f]+$": "^usb@[0-9a-f]+$":
$ref: snps,dwc3.yaml# $ref: snps,dwc3.yaml#
unevaluatedProperties: false
properties: properties:
wakeup-source: false wakeup-source: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment