Commit 418adabe authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Rob Herring
Browse files

dt-bindings: example: Extend with typical case (int-array and disallowed prop)



Extend the example with:
 - an array where each element has constraints (min/max value),
 - property not allowed in case of different compatible.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220223073547.8746-2-krzysztof.kozlowski@canonical.com
parent 2b709a72
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -162,6 +162,16 @@ properties:
      don't need a type.
      don't need a type.
    enum: [ 100, 200, 300 ]
    enum: [ 100, 200, 300 ]


  vendor,int-array-variable-length-and-constrained-values:
    description: Array might define what type of elements might be used (e.g.
      their range).
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 2
    maxItems: 3
    items:
      minimum: 0
      maximum: 8

  child-node:
  child-node:
    description: Child nodes are just another property from a json-schema
    description: Child nodes are just another property from a json-schema
      perspective.
      perspective.
@@ -207,6 +217,10 @@ allOf:
    then:
    then:
      required:
      required:
        - foo-supply
        - foo-supply
    else:
      # If otherwise the property is not allowed:
      properties:
        foo-supply: false
  # Altering schema depending on presence of properties is usually done by
  # Altering schema depending on presence of properties is usually done by
  # dependencies (see above), however some adjustments might require if:
  # dependencies (see above), however some adjustments might require if:
  - if:
  - if: