# LEDs connected to PWM

_Peios Kernel / Hardware and drivers / Device-tree binding reference / LED bindings_

> Device-tree binding reference for LEDs connected to PWM.

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;leds&#47;leds&#45;pwm&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Pavel Machek &#60;pavel&#64;ucw&#46;cz&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Each LED is represented as a sub-node of the pwm-leds device.  Each node's name represents the name of the corresponding LED.</p>
</div>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — not listed as required here

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;pwm&#45;leds&#34;</code></span>

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-a526bf0c7efd4a2cc79b"></a>

### <code>&#94;led&#40;&#45;&#91;0&#45;9a&#45;f&#93;&#43;&#41;&#63;&#36;</code> — name matches this regular expression

**Value type (<code>type</code>):** <span id="dt-40d2ca64c81d312fec7b"><code>&#34;object&#34;</code></span>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-b335a054f1d2d49b1858">[<code>common&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-leds/common.md#dt-root>)</span>

<a id="dt-236bbd6fd8350c956d98"></a>

#### Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-276a631dcc1071b479b2"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-bc0e92dbbb7ec96fae22"></a>

**<code>pwms</code> — required here**

**Maximum number of items (<code>maxItems</code>):** <span id="dt-3e8103b7553c0f1e1ba5"><code>1</code></span>

<a id="dt-f9e97afc02b6c85a8346"></a>

**<code>pwm&#45;names</code> — not listed as required here**

<code>true</code> — No constraints added by this property rule.

<a id="dt-844bd1e158c3960cb44f"></a>

**<code>max&#45;brightness</code> — required here**

<div id="dt-eea30189148dcda263fd">
<p style="white-space: pre-wrap">Maximum brightness possible for the LED</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1e7d19ff3c045f156485">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<a id="dt-9eb64195c9fb57ba7177"></a>

**<code>default&#45;brightness</code> — not listed as required here**

<div id="dt-48d1874756c4666b92a5">
<p style="white-space: pre-wrap">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.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-971fda59e88d798b0855">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<a id="dt-ef15ba0c87f67aae9391"></a>

**<code>enable&#45;gpios</code> — not listed as required here**

<div id="dt-1daf6d4af495126f42eb">
<p style="white-space: pre-wrap">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.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-675611630e10fe07d1a4"><code>1</code></span>

**Required in this object (<code>required</code>):** <a id="dt-4580ac82e583ae0b7504"></a> <span id="dt-6ab9920a875aa783f474"><code>&#34;pwms&#34;</code></span>, <span id="dt-2ccf2b36c10f6c0d2278"><code>&#34;max&#45;brightness&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">
#include &lt;dt-bindings/leds/common.h&gt;

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

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

    led-2 {
        color = &lt;LED_COLOR_ID_GREEN&gt;;
        function = LED_FUNCTION_CHARGING;
        pwms = &lt;&amp;twl_pwmled 0 7812500&gt;;
        max-brightness = &lt;255&gt;;
    };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

</details>
