Skip to content

Commit 2f25c1f

Browse files
committed
dts: bindings: led: introduce led-node.yaml
This patch moves the label and color-mapping LED property definitions from led-controller.yaml into led-node.yaml. This allows to use these properties from a LED node which is not a child node of a LED controller. This is preparatory work for adding the leds-group-multicolor binding. In addition this patch also removes the redundant "label" property definitions in gpio-leds.yaml and pwm-leds.yaml. It is now included from led-node.yaml. Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
1 parent 4a77680 commit 2f25c1f

File tree

4 files changed

+40
-29
lines changed

4 files changed

+40
-29
lines changed

dts/bindings/led/gpio-leds.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ compatible: "gpio-leds"
3636

3737
child-binding:
3838
description: GPIO LED child node
39+
40+
include:
41+
- name: led-node.yaml
42+
property-allowlist:
43+
- label
44+
3945
properties:
4046
gpios:
4147
type: phandle-array
4248
required: true
43-
label:
44-
type: string
45-
description: |
46-
Human readable string describing the LED. It can be used by an
47-
application to identify this LED or to retrieve its number/index
48-
(i.e. child node number) on the parent device.

dts/bindings/led/led-controller.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
child-binding:
77
description: LED child node
8+
9+
include: led-node.yaml
10+
811
properties:
9-
label:
10-
type: string
11-
description: Human readable string describing the LED
1212
index:
1313
type: int
1414
description: |
@@ -17,16 +17,3 @@ child-binding:
1717
controller. For example, this allows to handle boards where the
1818
LEDs in an array/strip are not wired following the LED order of
1919
the controller.
20-
color-mapping:
21-
type: array
22-
description: |
23-
Channel to color mapping of a multicolor LED. If a LED supports
24-
several colors, then the color-mapping property can be used to
25-
describe how the hardware channels and the colors are mapped.
26-
27-
For example the channel to color mapping of RGB LEDs would be
28-
29-
color-mapping =
30-
<LED_COLOR_ID_RED>,
31-
<LED_COLOR_ID_GREEN>,
32-
<LED_COLOR_ID_BLUE>;

dts/bindings/led/led-node.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2025 Seagate Technology LLC
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Common fields for LED nodes
5+
6+
properties:
7+
label:
8+
type: string
9+
description: |
10+
Human readable string describing the LED. It can be used by an
11+
application to identify this LED or to retrieve its number/index
12+
(i.e. child node number) on the parent device.
13+
color-mapping:
14+
type: array
15+
description: |
16+
Channel to color mapping of a multicolor LED. If a LED supports
17+
several colors, then the color-mapping property can be used to
18+
describe how the hardware channels and the colors are mapped.
19+
20+
For example the channel to color mapping of RGB LEDs would be
21+
22+
color-mapping =
23+
<LED_COLOR_ID_RED>,
24+
<LED_COLOR_ID_GREEN>,
25+
<LED_COLOR_ID_BLUE>;

dts/bindings/led/pwm-leds.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ compatible: "pwm-leds"
1010

1111
child-binding:
1212
description: PWM LED child node
13+
14+
include:
15+
- name: led-node.yaml
16+
property-allowlist:
17+
- label
18+
1319
properties:
1420
pwms:
1521
required: true
@@ -22,10 +28,3 @@ child-binding:
2228
brigtness granularity) and lesser than 50 milliseconds (average visual
2329
persistence time of the human eye). Typical values for the PWM period
2430
are 10 or 20 milliseconds.
25-
26-
label:
27-
type: string
28-
description: |
29-
Human readable string describing the LED. It can be used by an
30-
application to identify this LED or to retrieve its number/index
31-
(i.e. child node number) on the parent device.

0 commit comments

Comments
 (0)