# GPIO-based multiplexer controller

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

> Device-tree binding reference for GPIO-based multiplexer controller.

<!-- 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;mux&#47;gpio&#45;mux&#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;Peter Rosin &#60;peda&#64;axentia&#46;se&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Define what GPIO pins are used to control a multiplexer. Or several
multiplexers, if the same pins control more than one multiplexer.</p>
<p style="white-space: pre-wrap">The multiplexer state is defined as the number represented by the
multiplexer GPIO pins, where the first pin is the least significant
bit. An active pin is a binary 1, an inactive pin is a binary 0.</p>
</div>

<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;mux&#34;</code></span>

<a id="dt-474038e2038cc081a1e6"></a>

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

<div id="dt-3d434f8809298776c2b4">
<p style="white-space: pre-wrap">List of gpios used to control the multiplexer, least significant bit first.</p>
</div>

<a id="dt-39d5d5cbee79307f94c0"></a>

### <code>mux&#45;supply</code> — not listed as required here

<div id="dt-a8f706babe2cd8324663">
<p style="white-space: pre-wrap">Regulator to power on the multiplexer.</p>
</div>

<a id="dt-4be8fda9ca011e21c171"></a>

### <code>&#35;mux&#45;control&#45;cells</code> — not listed as required here

**Allowed values (<code>enum</code>):** <a id="dt-80c7a69d337d546a108f"></a> <span id="dt-f47a62f3b531a22e5b52"><code>0</code></span>, <span id="dt-bcf156d675a35c7dafdb"><code>1</code></span>

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

### <code>&#35;mux&#45;state&#45;cells</code> — not listed as required here

**Allowed values (<code>enum</code>):** <a id="dt-5a1a218a71cdf3a50c9f"></a> <span id="dt-768d023d05eac8b6aa41"><code>1</code></span>, <span id="dt-f6b4ee6e7f4eea515d16"><code>2</code></span>

<a id="dt-877dcb91674563236ebf"></a>

### <code>idle&#45;state</code> — not listed as required here

**Default value (<code>default</code>):** <span id="dt-d28d501859654bd240b5"><code>&#45;1</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;mux&#45;gpios&#34;</code></span>

<a id="dt-413065af65ac6af8f24e"></a>

## At least one of these rules must match (<code>anyOf</code>)

<a id="dt-96eb361b08260472facb"></a>

### Rule 1

> **Required in this object (<code>required</code>):** <a id="dt-a3ce052275bac2469e04"></a> <span id="dt-396aa8b3d1b1aeeb2c7a"><code>&#34;&#35;mux&#45;control&#45;cells&#34;</code></span>

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

### Rule 2

> **Required in this object (<code>required</code>):** <a id="dt-bb61b4b3827abc4e9b85"></a> <span id="dt-cffc196e945e46f91e3a"><code>&#34;&#35;mux&#45;state&#45;cells&#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/gpio/gpio.h&gt;

mux: mux-controller {
    compatible = "gpio-mux";
    #mux-control-cells = &lt;0&gt;;

    mux-gpios = &lt;&amp;pioA 0 GPIO_ACTIVE_HIGH&gt;,
          &lt;&amp;pioA 1 GPIO_ACTIVE_HIGH&gt;;
};

adc-mux {
    compatible = "io-channel-mux";
    io-channels = &lt;&amp;adc 0&gt;;
    io-channel-names = "parent";

    mux-controls = &lt;&amp;mux&gt;;

    channels = "sync-1", "in", "out", "sync-2";
};

i2c-mux {
    compatible = "i2c-mux";
    i2c-parent = &lt;&amp;i2c1&gt;;

    mux-controls = &lt;&amp;mux&gt;;

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

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

        ssd1307: oled@3c {
            reg = &lt;0x3c&gt;;
        };
    };

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

        pca9555: pca9555@20 {
            reg = &lt;0x20&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>
