Skip to content

Commit 94d4090

Browse files
rockosovlag-linaro
authored andcommitted
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: e338a05 ("dt-bindings: leds: Add binding for AW200xx") Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20231125200519.1750-12-ddrokosov@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 13b93b1 commit 94d4090

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

Documentation/devicetree/bindings/leds/awinic,aw200xx.yaml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ properties:
4545
maxItems: 1
4646

4747
patternProperties:
48-
"^led@[0-9a-f]$":
48+
"^led@[0-9a-f]+$":
4949
type: object
5050
$ref: common.yaml#
5151
unevaluatedProperties: false
@@ -69,6 +69,63 @@ patternProperties:
6969
where max-current-switch-number is determinated by led configuration
7070
and depends on how leds are physically connected to the led driver.
7171
72+
allOf:
73+
- if:
74+
properties:
75+
compatible:
76+
contains:
77+
const: awinic,aw20036
78+
then:
79+
patternProperties:
80+
"^led@[0-9a-f]+$":
81+
properties:
82+
reg:
83+
items:
84+
minimum: 0
85+
maximum: 36
86+
87+
- if:
88+
properties:
89+
compatible:
90+
contains:
91+
const: awinic,aw20054
92+
then:
93+
patternProperties:
94+
"^led@[0-9a-f]+$":
95+
properties:
96+
reg:
97+
items:
98+
minimum: 0
99+
maximum: 54
100+
101+
- if:
102+
properties:
103+
compatible:
104+
contains:
105+
const: awinic,aw20072
106+
then:
107+
patternProperties:
108+
"^led@[0-9a-f]+$":
109+
properties:
110+
reg:
111+
items:
112+
minimum: 0
113+
maximum: 72
114+
115+
- if:
116+
properties:
117+
compatible:
118+
contains:
119+
const: awinic,aw20108
120+
then:
121+
patternProperties:
122+
"^led@[0-9a-f]+$":
123+
properties:
124+
reg:
125+
items:
126+
minimum: 0
127+
maximum: 108
128+
72129
required:
73130
- compatible
74131
- reg

0 commit comments

Comments
 (0)