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

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.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 13b93b1d
...@@ -45,7 +45,7 @@ properties: ...@@ -45,7 +45,7 @@ properties:
maxItems: 1 maxItems: 1
patternProperties: patternProperties:
"^led@[0-9a-f]$": "^led@[0-9a-f]+$":
type: object type: object
$ref: common.yaml# $ref: common.yaml#
unevaluatedProperties: false unevaluatedProperties: false
...@@ -69,6 +69,63 @@ patternProperties: ...@@ -69,6 +69,63 @@ patternProperties:
where max-current-switch-number is determinated by led configuration where max-current-switch-number is determinated by led configuration
and depends on how leds are physically connected to the led driver. 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: required:
- compatible - compatible
- reg - reg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment