# ADC attached resistor ladder buttons

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

> Device-tree binding reference for ADC attached resistor ladder buttons.

<!-- SPDX-License-Identifier: GPL-2.0 -->


<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;input&#47;adc&#45;keys&#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;Alexandre Belloni &#60;alexandre&#46;belloni&#64;bootlin&#46;com&#62;&#34;</code></span>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

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

### Rule 1

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

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

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

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

### <code>compatible</code> — required here

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

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

### <code>io&#45;channels</code> — required here

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

<a id="dt-52503acc5d03431d5405"></a>

### <code>io&#45;channel&#45;names</code> — required here

**Exact value (<code>const</code>):** <span id="dt-27bb6bb6712fac2e8172"><code>&#34;buttons&#34;</code></span>

<a id="dt-206cc10e1303c9452b95"></a>

### <code>keyup&#45;threshold&#45;microvolt</code> — required here

<div id="dt-541955c4bf4e328d4cf7">
<p style="white-space: pre-wrap">Voltage above or equal to which all the keys are considered up.</p>
</div>

<a id="dt-014743e3c59fc92ab9b6"></a>

### <code>poll&#45;interval</code> — not listed as required here

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

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

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

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

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

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

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

### <code>&#94;button&#45;</code> — name matches this regular expression

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

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

<a id="dt-28ff2bf453fb36a440c0"></a>

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

<code>false</code>

Not allowed by this rule.

<div id="dt-e91ed35854da3df940d8">
<p style="white-space: pre-wrap">Each button (key) is represented as a sub-node.</p>
</div>

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

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

<a id="dt-490a5bdc12d891fbb282"></a>

**<code>label</code> — not listed as required here**

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

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

**<code>linux&#44;code</code> — required here**

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

<a id="dt-094ffcd7ae7bb980b5bd"></a>

**<code>press&#45;threshold&#45;microvolt</code> — required here**

<div id="dt-19037e070973498b762f">
<p style="white-space: pre-wrap">Voltage above or equal to which this key is considered pressed. No two values of press-threshold-microvolt may be the same. All values of press-threshold-microvolt must be less than keyup-threshold-microvolt.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-04b91050292af18e0bce"></a> <span id="dt-620d6371654bfab8eee1"><code>&#34;linux&#44;code&#34;</code></span>, <span id="dt-9db8366bae9233686d9d"><code>&#34;press&#45;threshold&#45;microvolt&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;io&#45;channels&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;io&#45;channel&#45;names&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;keyup&#45;threshold&#45;microvolt&#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/input/input.h&gt;
// +--------------------------------+------------------------+
// | 2.000.000 &lt;= value             | no key pressed         |
// +--------------------------------+------------------------+
// | 1.500.000 &lt;= value &lt; 2.000.000 | KEY_VOLUMEUP pressed   |
// +--------------------------------+------------------------+
// | 1.000.000 &lt;= value &lt; 1.500.000 | KEY_VOLUMEDOWN pressed |
// +--------------------------------+------------------------+
// |   500.000 &lt;= value &lt; 1.000.000 | KEY_ENTER pressed      |
// +--------------------------------+------------------------+
// |              value &lt;   500.000 | no key pressed         |
// +--------------------------------+------------------------+

adc-keys {
    compatible = "adc-keys";
    io-channels = &lt;&amp;lradc 0&gt;;
    io-channel-names = "buttons";
    keyup-threshold-microvolt = &lt;2000000&gt;;

    button-up {
        label = "Volume Up";
        linux,code = &lt;KEY_VOLUMEUP&gt;;
        press-threshold-microvolt = &lt;1500000&gt;;
    };

    button-down {
        label = "Volume Down";
        linux,code = &lt;KEY_VOLUMEDOWN&gt;;
        press-threshold-microvolt = &lt;1000000&gt;;
    };

    button-enter {
        label = "Enter";
        linux,code = &lt;KEY_ENTER&gt;;
        press-threshold-microvolt = &lt;500000&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</span></p>

</details>
