Commit 94d4090b authored by Dmitry Rokosov's avatar Dmitry Rokosov Committed by Lee Jones
Browse files

dt-bindings: leds: aw200xx: Fix led pattern and add reg constraints



AW200XX controllers have the capability to declare more than 0xf LEDs,
therefore, it is necessary to accept LED names using an appropriate
regex pattern.

The register offsets can be adjusted within the specified range, with
the maximum value corresponding to the highest number of LEDs that can
be connected to the controller.

Fixes: e338a05e ("dt-bindings: leds: Add binding for AW200xx")
Signed-off-by: default avatarDmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231125200519.1750-12-ddrokosov@salutedevices.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 13b93b1d
Loading
Loading
Loading
Loading
+58 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ properties:
    maxItems: 1

patternProperties:
  "^led@[0-9a-f]$":
  "^led@[0-9a-f]+$":
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false
@@ -69,6 +69,63 @@ patternProperties:
          where max-current-switch-number is determinated by led configuration
          and depends on how leds are physically connected to the led driver.

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: awinic,aw20036
    then:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 36

  - if:
      properties:
        compatible:
          contains:
            const: awinic,aw20054
    then:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 54

  - if:
      properties:
        compatible:
          contains:
            const: awinic,aw20072
    then:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 72

  - if:
      properties:
        compatible:
          contains:
            const: awinic,aw20108
    then:
      patternProperties:
        "^led@[0-9a-f]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 108

required:
  - compatible
  - reg