Multi-color LED built with monochromatic LEDs

Schema identifier ($id): "http://devicetree.org/schemas/leds/leds-group-multicolor.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Jean-Jacques Hiblot <jjhiblot@traphandler.com>"

This driver combines several monochromatic LEDs into one multi-color LED using the multicolor LED class.

Properties and child nodes (properties) #

compatible — not listed as required here #

Exact value (const): "leds-group-multicolor"

leds — required here #

true — No constraints added by this property rule.

Required in this object (required): "leds"

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): leds-class-multicolor.yaml#

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>

monochromatic-leds {
    compatible = "gpio-leds";

    led0: led-0 {
        gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>;
        color = <LED_COLOR_ID_RED>;
    };

    led1: led-1 {
        gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>;
        color = <LED_COLOR_ID_GREEN>;
    };

    led2: led-2 {
        gpios = <&mcu_pio 2 GPIO_ACTIVE_HIGH>;
        color = <LED_COLOR_ID_BLUE>;
    };
};

multi-led {
    compatible = "leds-group-multicolor";
    color = <LED_COLOR_ID_RGB>;
    function = LED_FUNCTION_INDICATOR;
    leds = <&led0>, <&led1>, <&led2>;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

Edit this page