Skip to content

Commit ac12374

Browse files
svenschwermerpavelmachek
authored andcommitted
dt-bindings: leds: Add multicolor PWM LED bindings
This allows to group multiple PWM-connected monochrome LEDs into multicolor LEDs, e.g. RGB LEDs. Signed-off-by: Sven Schwermer <sven.schwermer@disruptive-technologies.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
1 parent 21c0d13 commit ac12374

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/leds/leds-pwm-multicolor.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Multi-color LEDs connected to PWM
8+
9+
maintainers:
10+
- Sven Schwermer <sven.schwermer@disruptive-technologies.com>
11+
12+
description: |
13+
This driver combines several monochrome PWM LEDs into one multi-color
14+
LED using the multicolor LED class.
15+
16+
properties:
17+
compatible:
18+
const: pwm-leds-multicolor
19+
20+
multi-led:
21+
type: object
22+
23+
patternProperties:
24+
"^led-[0-9a-z]+$":
25+
type: object
26+
$ref: common.yaml#
27+
28+
additionalProperties: false
29+
30+
properties:
31+
pwms:
32+
maxItems: 1
33+
34+
pwm-names: true
35+
36+
color: true
37+
38+
required:
39+
- pwms
40+
- color
41+
42+
required:
43+
- compatible
44+
45+
allOf:
46+
- $ref: leds-class-multicolor.yaml#
47+
48+
additionalProperties: false
49+
50+
examples:
51+
- |
52+
#include <dt-bindings/leds/common.h>
53+
54+
led-controller {
55+
compatible = "pwm-leds-multicolor";
56+
57+
multi-led {
58+
color = <LED_COLOR_ID_RGB>;
59+
function = LED_FUNCTION_INDICATOR;
60+
max-brightness = <65535>;
61+
62+
led-red {
63+
pwms = <&pwm1 0 1000000>;
64+
color = <LED_COLOR_ID_RED>;
65+
};
66+
67+
led-green {
68+
pwms = <&pwm2 0 1000000>;
69+
color = <LED_COLOR_ID_GREEN>;
70+
};
71+
72+
led-blue {
73+
pwms = <&pwm3 0 1000000>;
74+
color = <LED_COLOR_ID_BLUE>;
75+
};
76+
};
77+
};
78+
79+
...

0 commit comments

Comments
 (0)