# Common leds consumer

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

> Device-tree binding reference for Common leds consumer.

<!-- 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;consumer&#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;Aleksandrs Vinarskis &#60;alex&#64;vinarskis&#46;com&#62;&#34;</code></span>

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

<a id="dt-865ef19e891fb9fe7b15"></a>

## Automatic schema selection (<code>select</code>)

<code>true</code>

This selection rule always matches.

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

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

<a id="dt-85c9b34b55b27f5ea876"></a>

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

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

#### Exactly one of these rules must match (<code>oneOf</code>)

<a id="dt-10d1d50af07ac2568dbb"></a>

**Rule 1**

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

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

**Rule 2**

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-11441b7892771c97df4b">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-8f5710c4314b4caa4970>)</span>
>
> <div id="dt-1a8446ef48ea6535f023">
> <p style="white-space: pre-wrap">A list of LED device(s) required by a particular consumer.</p>
> </div>
>
> <a id="dt-96b4980ee7d4809c5235"></a>
>
> **Array item rules (<code>items</code>)**
>
> > **Maximum number of items (<code>maxItems</code>):** <span id="dt-fa8fa4b3246ff3983169"><code>1</code></span>

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

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

<div id="dt-1c687da182f0ae04a266">
<p style="white-space: pre-wrap">A list of device name(s). Used to map LED devices to their respective functions, when consumer requires more than one LED.</p>
</div>

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

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

<code>true</code>

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/gpio/gpio.h&gt;
#include &lt;dt-bindings/leds/common.h&gt;

leds {
    compatible = "gpio-leds";

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

i2c {
  #address-cells = &lt;1&gt;;
  #size-cells = &lt;0&gt;;

  v4l2_node: camera@36 {
    reg = &lt;0x36&gt;;

    leds = &lt;&amp;privacy_led&gt;;
    led-names = "privacy";
  };
};
</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>
