# GPIO matrix keypad

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

> Device-tree binding reference for GPIO matrix keypad.

<!-- 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;input&#47;gpio&#45;matrix&#45;keypad&#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;Marek Vasut &#60;marek&#46;vasut&#64;gmail&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">GPIO driven matrix keypad is used to interface a SoC with a matrix keypad. The matrix keypad supports multiple row and column lines, a key can be placed at each intersection of a unique row and a unique column. The matrix keypad can sense a key-press and key-release by means of GPIO lines and report the event using GPIO interrupts to the cpu.</p>
</div>

<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>&#47;schemas&#47;input&#47;matrix&#45;keymap&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-input/matrix-keymap.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;gpio&#45;matrix&#45;keypad&#34;</code></span>

<a id="dt-452e65a5c51bfd159f57"></a>

### <code>row&#45;gpios</code> — required here

<div id="dt-5852b2c8f1de2e908fa1">
<p style="white-space: pre-wrap">List of GPIOs used as row lines. The gpio specifier for this property depends on the gpio controller to which these row lines are connected.</p>
</div>

<a id="dt-401bd8e2de2b1a81b163"></a>

### <code>col&#45;gpios</code> — required here

<div id="dt-fced609cb63d20fd4b3a">
<p style="white-space: pre-wrap">List of GPIOs used as column lines. The gpio specifier for this property depends on the gpio controller to which these column lines are connected.</p>
</div>

<a id="dt-8c9c353c8c60bb4f347a"></a>

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

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

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

### <code>linux&#44;no&#45;autorepeat</code> — not listed as required here

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

<div id="dt-ca21d90a3949b035dcf4">
<p style="white-space: pre-wrap">Do not enable autorepeat feature.</p>
</div>

<a id="dt-6873053b51a91ae4ebe8"></a>

### <code>gpio&#45;activelow</code> — not listed as required here

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

<div id="dt-7219631954e71c9f3546">
<p style="white-space: pre-wrap">Force GPIO polarity to active low. In the absence of this property GPIOs are treated as active high.</p>
</div>

<a id="dt-74490819fc7046060b9d"></a>

### <code>debounce&#45;delay&#45;ms</code> — not listed as required here

<div id="dt-2f4f9fe89298cc4de890">
<p style="white-space: pre-wrap">Debounce interval in milliseconds.</p>
</div>

**Default value (<code>default</code>):** <span id="dt-d74bd4f561b9143ada21"><code>0</code></span>

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

### <code>col&#45;scan&#45;delay&#45;us</code> — not listed as required here

<div id="dt-055bfc0e80cc5e176c03">
<p style="white-space: pre-wrap">Delay, measured in microseconds, that is needed before we can scan keypad after activating column gpio.</p>
</div>

**Default value (<code>default</code>):** <span id="dt-26e31ff15d9819a8012e"><code>0</code></span>

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

### <code>all&#45;cols&#45;on&#45;delay&#45;us</code> — not listed as required here

<div id="dt-c6ee193202b8d2d3c59f">
<p style="white-space: pre-wrap">Delay, measured in microseconds, that is needed after activating all column gpios.</p>
</div>

**Default value (<code>default</code>):** <span id="dt-6319db25daf3166b3225"><code>0</code></span>

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

### <code>drive&#45;inactive&#45;cols</code> — not listed as required here

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

<div id="dt-3608c7556f5f95f0dd7b">
<p style="white-space: pre-wrap">Drive inactive columns during scan, default is to turn inactive columns into inputs.</p>
</div>

<a id="dt-2a09d6d20023955671c8"></a>

### <code>wakeup&#45;source</code> — not listed as required here

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

**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;row&#45;gpios&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;col&#45;gpios&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;linux&#44;keymap&#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">matrix-keypad {
    compatible = "gpio-matrix-keypad";
    debounce-delay-ms = &lt;5&gt;;
    col-scan-delay-us = &lt;2&gt;;

    row-gpios = &lt;&amp;gpio2 25 0
                 &amp;gpio2 26 0
                 &amp;gpio2 27 0&gt;;

    col-gpios = &lt;&amp;gpio2 21 0
                 &amp;gpio2 22 0&gt;;

    linux,keymap = &lt;0x0000008B
                    0x0100009E
                    0x02000069
                    0x0001006A
                    0x0101001C
                    0x0201006C&gt;;

    wakeup-source;
};
</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>
