LEDs connected to PWM

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

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

Maintainers (maintainers): "Pavel Machek <pavel@ucw.cz>"

Each LED is represented as a sub-node of the pwm-leds device. Each node's name represents the name of the corresponding LED.

Properties and child nodes (properties) #

compatible — not listed as required here #

Exact value (const): "pwm-leds"

Properties matching a name pattern (patternProperties) #

^led(-[0-9a-f]+)?$ — name matches this regular expression #

Value type (type): "object"

Shared schema rule ($ref): common.yaml#

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Properties and child nodes (properties) #

pwms — required here

Maximum number of items (maxItems): 1

pwm-names — not listed as required here

true — No constraints added by this property rule.

max-brightness — required here

Maximum brightness possible for the LED

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

default-brightness — not listed as required here

Brightness to be set if LED's default state is on. Used only during initialization. If the option is not set then max brightness is used.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32

enable-gpios — not listed as required here

GPIO for LED hardware enable control. Set active when brightness is non-zero and inactive when brightness is zero. The GPIO default state follows the "default-state" property.

Maximum number of items (maxItems): 1

Required in this object (required): "pwms", "max-brightness"

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

false

Not allowed by this rule.

Examples (examples) #


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

led-controller {
    compatible = "pwm-leds";

    led-1 {
        label = "omap4::keypad";
        pwms = <&twl_pwm 0 7812500>;
        max-brightness = <127>;
    };

    led-2 {
        color = <LED_COLOR_ID_GREEN>;
        function = LED_FUNCTION_CHARGING;
        pwms = <&twl_pwmled 0 7812500>;
        max-brightness = <255>;
    };
};

Source notes #

Annotations retained from the schema source

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

Edit this page