Commit de40c849 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Pavel Machek
Browse files

dt-bindings: leds: class-multicolor: reference class directly in multi-led node



The leds/common.yaml is referenced directly in each LED node, which
leads to people doing the same with leds/leds-class-multicolor.yaml.
This is not correct because leds-class-multicolor.yaml defined multi-led
property and its children.  Some schemas implemented this incorrect.

Rework this to match same behavior common.yaml, so expect the multi-led
node to reference the leds-class-multicolor.yaml.  Fixing allows to add
unevaluatedProperties:false.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent a0ba6920
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ patternProperties:
  "^multi-led@[0-9a-b]$":
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    description:
      This node represents one of the RGB LED devices on Turris Omnia.
      No subnodes need to be added for subchannels since this controller only
+16 −16
Original line number Diff line number Diff line
@@ -19,11 +19,10 @@ description: |
  LED class.  Common LED nodes and properties are inherited from the common.yaml
  within this documentation directory.

patternProperties:
  "^multi-led(@[0-9a-f])?$":
    type: object
    description: Represents the LEDs that are to be grouped.
properties:
  $nodename:
    pattern: "^multi-led(@[0-9a-f])?$"

  color:
    description: |
      For multicolor LED support this property should be defined as either
@@ -31,11 +30,12 @@ patternProperties:
      include/linux/leds/common.h.
    enum: [ 8, 9 ]

    $ref: "common.yaml#"

required:
  - color

allOf:
  - $ref: "common.yaml#"

additionalProperties: true

...
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ patternProperties:
  '^multi-led@[0-9a-f]$':
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        minItems: 1
+2 −3
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ properties:

  multi-led:
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    patternProperties:
      "^led-[0-9a-z]+$":
@@ -46,9 +48,6 @@ properties:
required:
  - compatible

allOf:
  - $ref: leds-class-multicolor.yaml#

additionalProperties: false

examples:
+2 −0
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ properties:
  multi-led:
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    properties:
      "#address-cells":
        const: 1