Common leds consumer

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

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

Maintainers (maintainers): "Aleksandrs Vinarskis <alex@vinarskis.com>"

Some LED defined in DT are required by other DT consumers, for example v4l2 subnode may require privacy or flash LED. Unlike trigger-source approach which is typically used as 'soft' binding, referencing LED devices by phandle makes things simpler when 'hard' binding is desired. Document LED properties that its consumers may define.

Automatic schema selection (select) #

true

This selection rule always matches.

Properties and child nodes (properties) #

leds — not listed as required here #

Exactly one of these rules must match (oneOf) #

Rule 1

Value type (type): "object"

Rule 2

Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array

A list of LED device(s) required by a particular consumer.

Array item rules (items)

Maximum number of items (maxItems): 1

led-names — not listed as required here #

A list of device name(s). Used to map LED devices to their respective functions, when consumer requires more than one LED.

Properties not matched by properties or patternProperties in this schema (additionalProperties) #

true

Allowed by this rule.

Examples (examples) #

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

leds {
    compatible = "gpio-leds";

    privacy_led: privacy-led {
        color = <LED_COLOR_ID_RED>;
        default-state = "off";
        function = LED_FUNCTION_INDICATOR;
        gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
    };
};

i2c {
  #address-cells = <1>;
  #size-cells = <0>;

  v4l2_node: camera@36 {
    reg = <0x36>;

    leds = <&privacy_led>;
    led-names = "privacy";
  };
};

Source notes #

Annotations retained from the schema source

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

Edit this page