From b97dcef8ce7fe7eb319fc7f81421e34715566742 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Fri, 22 Mar 2024 11:22:19 +0100 Subject: [PATCH] dts: bindings: led: introduce leds-group-multicolor binding The leds-group-multicolor binding allows to combines several monochromatic LEDs into one multi-color LED. Signed-off-by: Simon Guinot --- dts/bindings/led/leds-group-multicolor.yaml | 49 +++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 dts/bindings/led/leds-group-multicolor.yaml diff --git a/dts/bindings/led/leds-group-multicolor.yaml b/dts/bindings/led/leds-group-multicolor.yaml new file mode 100644 index 00000000000..4a6008b151d --- /dev/null +++ b/dts/bindings/led/leds-group-multicolor.yaml @@ -0,0 +1,49 @@ +# Copyright (c) 2025 Seagate Technology LLC +# SPDX-License-Identifier: Apache-2.0 + +title: Combines several monochromatic LEDs into one multi-color LED. + +description: | + Here is an example that defines an RGB LED with a group of monochromatic + PWM LEDs. Note that the pwms property definition handle depends on the PWM + controller model. In this example, an STM32 PWM controller is assumed. + + #include + + / { + monochromatic-leds { + compatible = "pwm-leds"; + + red_pwm_led: led-0 { + pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + + green_pwm_led: led-1 { + pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + + blue_pwm_led: led-2 { + pwms = <&pwm3 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; + + rgb-led { + compatible = "leds-group-multicolor"; + + leds = <&red_pwm_led>, <&green_pwm_led>, <&blue_pwm_led>; + color-mapping = , + , + ; + }; + }; + +compatible: "leds-group-multicolor" + +include: led-node.yaml + +properties: + leds: + required: true + type: phandles + description: | + References to monochromatic LED nodes.