dt-bindings: chrome: google,cros-ec-typec: restrict allowed properties
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 11 Aug 2022 06:22:45 +0000 (09:22 +0300)
committerRob Herring <robh@kernel.org>
Fri, 12 Aug 2022 17:13:32 +0000 (11:13 -0600)
Describe exactly what properties are allowed in Google Chrome OS EC Type
C port, so the schema can properly validate the DTS.  Existing DTS
defines always connectors with unit addresses, not a sole "connector"
child.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220811062245.4316-1-krzysztof.kozlowski@linaro.org
Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml

index 2d98f7c..50ebd8c 100644 (file)
@@ -20,13 +20,24 @@ properties:
   compatible:
     const: google,cros-ec-typec
 
-  connector:
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  '^connector@[0-9a-f]+$':
     $ref: /schemas/connector/usb-connector.yaml#
+    unevaluatedProperties: false
+    properties:
+      reg:
+        maxItems: 1
 
 required:
   - compatible
 
-additionalProperties: true #fixme
+additionalProperties: false
 
 examples:
   - |+