Commit 42839dca authored by Rob Herring's avatar Rob Herring Committed by Lee Jones
Browse files

dt-bindings: mfd: Add missing (unevaluated|additional)Properties on child nodes



In order to ensure only documented properties are present, node schemas
must have unevaluatedProperties or additionalProperties set to false
(typically).

Signed-off-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
Acked-by: default avatarAlistair Francis <alistair@alistair23.me>
Reviewed-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarLee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20220823145649.3118479-4-robh@kernel.org
parent a47137a5
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ properties:
patternProperties:
  "^.*_(clk|rst)$":
    type: object
    unevaluatedProperties: false

    properties:
      compatible:
@@ -34,6 +35,45 @@ patternProperties:
          - fixed-factor-clock

    allOf:
      - if:
          properties:
            compatible:
              contains:
                const: fixed-factor-clock

        then:
          $ref: /schemas/clock/fixed-factor-clock.yaml#

      - if:
          properties:
            compatible:
              contains:
                const: allwinner,sun4i-a10-mod0-clk

        then:
          properties:
            "#clock-cells":
              const: 0

            # Already checked in the main schema
            compatible: true

            clocks:
              maxItems: 2

            clock-output-names:
              maxItems: 1

            phandle: true

          required:
            - "#clock-cells"
            - compatible
            - clocks
            - clock-output-names

          additionalProperties: false

      - if:
          properties:
            compatible:
+10 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ properties:
patternProperties:
  "^.*(clk|rst|codec).*$":
    type: object
    unevaluatedProperties: false

    properties:
      compatible:
@@ -36,6 +37,15 @@ patternProperties:
      - compatible

    allOf:
      - if:
          properties:
            compatible:
              contains:
                const: fixed-factor-clock

        then:
          $ref: /schemas/clock/fixed-factor-clock.yaml#

      - if:
          properties:
            compatible:
+5 −0
Original line number Diff line number Diff line
@@ -144,6 +144,7 @@ properties:
      CODECs digital core if not being provided by an internal regulator.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false
    properties:
      compatible:
        enum:
@@ -161,6 +162,7 @@ properties:
      CODECs MICVDD.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false
    properties:
      compatible:
        enum:
@@ -177,6 +179,7 @@ properties:
      Initialisation data for the MIC1VDD supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false
    properties:
      compatible:
        enum:
@@ -202,6 +205,7 @@ properties:
      Initialisation data for the MIC2VDD supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false
    properties:
      compatible:
        enum:
@@ -228,6 +232,7 @@ properties:
      the CODECs analog and 1.8V digital supplies.
    type: object
    $ref: /schemas/regulator/regulator.yaml#
    unevaluatedProperties: false
    properties:
      compatible:
        enum:
+4 −3
Original line number Diff line number Diff line
@@ -71,8 +71,9 @@ properties:

  regulators:
    type: object
    additionalProperties: false
    patternProperties:
      "^(ldo[1-11]|bcore[1-2]|bpro|bmem|bio|bperi)$":
      "^(ldo([1-9]|1[01])|bcore[1-2]|bpro|bmem|bio|bperi)$":
        $ref: /schemas/regulator/regulator.yaml
        unevaluatedProperties: false

@@ -112,7 +113,7 @@ examples:
        };

        regulators {
          regulator-bcore1 {
          bcore1 {
            regulator-name = "BCORE1";
            regulator-min-microvolt = <300000>;
            regulator-max-microvolt = <1570000>;
@@ -120,7 +121,7 @@ examples:
            regulator-max-microamp = <2000000>;
            regulator-boot-on;
          };
          regulator-ldo11 {
          ldo11 {
            regulator-name = "LDO_11";
            regulator-min-microvolt = <900000>;
            regulator-max-microvolt = <3600000>;
+4 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ properties:

  adc:
    type: object
    additionalProperties: false
    description: Optional hardware monitoring module

    properties:
@@ -59,8 +60,9 @@ properties:
        const: 0

    patternProperties:
      "^channel@[0-9]+$":
      "^channel@[0-9a-f]+$":
        type: object
        additionalProperties: false
        description: |
          Properties for a single ADC which can report cooked values
          (i.e. temperature sensor based on thermister), raw values
@@ -113,6 +115,7 @@ properties:
patternProperties:
  "^fan-controller@[0-9a-f]+$":
    type: object
    additionalProperties: false
    description: Optional fan controller

    properties:
Loading