# Generic register bitfield-based multiplexer controller

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

> Device-tree binding reference for Generic register bitfield-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;reg&#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 register bitfields to be used to control multiplexers. The parent
device tree node must be a device node to provide register r/w access.</p>
</div>

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

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

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

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

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;reg&#45;mux&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;mmio&#45;mux&#34;</code></span>

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

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

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

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

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

**Exact value (<code>const</code>):** <span id="dt-6463d93d8cf09f2c387c"><code>1</code></span>

<a id="dt-289055ac3e4c96a3abc1"></a>

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

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

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

#### Array item rules (<code>items</code>)

> <a id="dt-fd9e94eec41a1bb1a293"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-428cc998e4a7ec4ac6c8"></a>
>
> **Item 1**
>
> > <div id="dt-f91d053cca2ed2c5490b">
> > <p style="white-space: pre-wrap">register offset</p>
> > </div>
>
> <a id="dt-4b1e97c6e3302b84dc13"></a>
>
> **Item 2**
>
> > <div id="dt-9cfcd7883e15e68d2c3c">
> > <p style="white-space: pre-wrap">pre-shifted bitfield mask</p>
> > </div>

<div id="dt-58a63772b5a69491d8fa">
<p style="white-space: pre-wrap">Each entry pair describes a single mux control.</p>
</div>

<a id="dt-686633d6bd62cce5c40a"></a>

### <code>idle&#45;states</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;mux&#45;reg&#45;masks&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;&#35;mux&#45;control&#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">/* The parent device of mux controller is not a syscon device. */

#include &lt;dt-bindings/mux/mux.h&gt;

mux-controller {
    compatible = "reg-mux";
    #mux-control-cells = &lt;1&gt;;
    mux-reg-masks =
        &lt;0x54 0xf8&gt;, /* 0: reg 0x54, bits 7:3 */
        &lt;0x54 0x07&gt;; /* 1: reg 0x54, bits 2:0 */
};

mdio-mux-1 {
    compatible = "mdio-mux-multiplexer";
    mux-controls = &lt;&amp;mux1 0&gt;;
    mdio-parent-bus = &lt;&amp;emdio1&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    mdio@0 {
        reg = &lt;0x0&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
    };

    mdio@8 {
        reg = &lt;0x8&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
    };
};

mdio-mux-2 {
    compatible = "mdio-mux-multiplexer";
    mux-controls = &lt;&amp;mux1 1&gt;;
    mdio-parent-bus = &lt;&amp;emdio2&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    mdio@0 {
        reg = &lt;0x0&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
    };

    mdio@1 {
        reg = &lt;0x1&gt;;
        #address-cells = &lt;1&gt;;
        #size-cells = &lt;0&gt;;
    };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">/* The parent device of mux controller is syscon device. */

#include &lt;dt-bindings/mux/mux.h&gt;
syscon@1000 {
    reg = &lt;0x1000 0x100&gt;;

    mux2: mux-controller {
        compatible = "mmio-mux";
        #mux-control-cells = &lt;1&gt;;

        mux-reg-masks =
            &lt;0x3 0x30&gt;, /* 0: reg 0x3, bits 5:4 */
            &lt;0x3 0x40&gt;; /* 1: reg 0x3, bit 6 */
        idle-states = &lt;MUX_IDLE_AS_IS&gt;, &lt;0&gt;;
    };
};

video-mux {
    compatible = "video-mux";
    mux-controls = &lt;&amp;mux2 0&gt;;
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

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

        /* inputs 0..3 */
        port@0 {
            reg = &lt;0&gt;;
        };
        port@1 {
            reg = &lt;1&gt;;
        };
        port@2 {
            reg = &lt;2&gt;;
        };
        port@3 {
            reg = &lt;3&gt;;
        };

        /* output */
        port@4 {
            reg = &lt;4&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>

<p id="dt-comment-1"><strong>Line 19:</strong> <span> parent device of mux controller is not syscon device</span></p>

<p id="dt-comment-2"><strong>Line 20:</strong> <span> parent device of mux controller is syscon device</span></p>

</details>
