# Mux bindings

---

# 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>

---

# Common multiplexer controller consumer

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

> Device-tree binding reference for Common multiplexer controller consumer.

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

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Mux controller consumers should specify a list of mux controllers that they
want to use with a property containing a 'mux-ctrl-list':</p>
<pre><code>  mux-ctrl-list ::= &lt;single-mux-ctrl&gt; [mux-ctrl-list]
  single-mux-ctrl ::= &lt;mux-ctrl-phandle&gt; [mux-ctrl-specifier]
  mux-ctrl-phandle : phandle to mux controller node
  mux-ctrl-specifier : array of #mux-control-cells specifying the
                       given mux controller (controller specific)</code></pre>
<p style="white-space: pre-wrap">Mux controller properties should be named "mux-controls". The exact meaning of
each mux controller property must be documented in the device tree binding for
each consumer. An optional property "mux-control-names" may contain a list of
strings to label each of the mux controllers listed in the "mux-controls"
property.</p>
<p style="white-space: pre-wrap">If it is required to provide the state that the mux controller needs to
be set to, the property "mux-states" must be used. An optional property
"mux-state-names" can be used to provide a list of strings, to label
each of the multiplixer states listed in the "mux-states" property.</p>
<p style="white-space: pre-wrap">Properties "mux-controls" and "mux-states" can be used depending on how
the consumers want to control the mux controller. If the consumer needs
needs to set multiple states in a mux controller, then property
"mux-controls" can be used. If the consumer needs to set the mux
controller to a given state then property "mux-states" can be used.</p>
<p style="white-space: pre-wrap">mux-ctrl-specifier typically encodes the chip-relative mux controller number.
If the mux controller chip only provides a single mux controller, the
mux-ctrl-specifier can typically be left out.</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-9ae71978f004bcd28791"></a>

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-924312f386431bb50909">[<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>

<a id="dt-7c8172d28de7effdcda0"></a>

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-773c584138dc066d517e">[<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>

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

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

<div id="dt-abbc31c6045d84976466">
<p style="white-space: pre-wrap">Devices that use more than a single mux controller can use the "mux-control-names" property to map the name of the requested mux controller to an index into the list given by the "mux-controls" property.</p>
</div>

<a id="dt-0620e4a0be54e52ed2f3"></a>

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

<div id="dt-1498fd385302e9b4ba06">
<p style="white-space: pre-wrap">Devices that use more than a single multiplexer state can use the "mux-state-names" property to map the name of the requested mux controller to an index into the list given by the "mux-states" property.</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.

## 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>

---

# Common multiplexer controller provider

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

> Device-tree binding reference for Common multiplexer controller provider.

<!-- 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;mux&#45;controller&#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">A multiplexer (or mux) controller will have one, or several, consumer devices
that uses the mux controller. Thus, a mux controller can possibly control
several parallel multiplexers. Presumably there will be at least one
multiplexer needed by each consumer, but a single mux controller can of course
control several multiplexers for a single consumer.</p>
<p style="white-space: pre-wrap">A mux controller provides a number of states to its consumers, and the state
space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer,
0-7 for an 8-way multiplexer, etc.</p>
<p style="white-space: pre-wrap">Mux controller nodes
--------------------</p>
<p style="white-space: pre-wrap">Mux controller nodes must specify the number of cells used for the
specifier using the '#mux-control-cells' or '#mux-state-cells' property.
The value of '#mux-state-cells' will always be one greater than the value
of '#mux-control-cells'.</p>
<p style="white-space: pre-wrap">Optionally, mux controller nodes can also specify the state the mux should
have when it is idle. The idle-state property is used for this. If the
idle-state is not present, the mux controller is typically left as is when
it is idle. For multiplexer chips that expose several mux controllers, the
idle-state property is an array with one idle state for each mux controller.</p>
<p style="white-space: pre-wrap">The special value (-1) may be used to indicate that the mux should be left
as is when it is idle. This is the default, but can still be useful for
mux controller chips with more than one mux controller, particularly when
there is a need to "step past" a mux controller and set some other idle
state for a mux controller with a higher index.</p>
<p style="white-space: pre-wrap">Some mux controllers have the ability to disconnect the input/output of the
multiplexer. Using this disconnected high-impedance state as the idle state
is indicated with idle state (-2).</p>
<p style="white-space: pre-wrap">These constants are available in</p>
<pre><code>      #include &lt;dt-bindings/mux/mux.h&gt;</code></pre>
<p style="white-space: pre-wrap">as MUX_IDLE_AS_IS (-1) and MUX_IDLE_DISCONNECT (-2).</p>
<p style="white-space: pre-wrap">An example mux controller node look like this (the adg972a chip is a triple
4-way multiplexer):</p>
<pre><code>  mux: mux-controller@50 {
    compatible = "adi,adg792a";
    reg = &lt;0x50&gt;;
    #mux-control-cells = &lt;1&gt;;</code></pre>
<pre><code>    idle-state = &lt;MUX_IDLE_DISCONNECT MUX_IDLE_AS_IS 2&gt;;
  };</code></pre>
</div>

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

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

> <a id="dt-dff73b75195f2859c26d"></a>
>
> ### At least one of these rules must match (<code>anyOf</code>)
>
> <a id="dt-1f26a5b7c60825363a68"></a>
>
> #### Rule 1
>
> > <a id="dt-21636068e2bd2c55eef0"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-7b18d9494c4fa1557e6d"></a>
> >
> > **<code>&#36;nodename</code> — not listed as required here**
> >
> > **String pattern (<code>pattern</code>):** <span id="dt-30c84f10c31239b0a977"><code>&#34;&#94;mux&#45;controller&#34;</code></span>
>
> <a id="dt-974c41ac981574aea151"></a>
>
> #### Rule 2
>
> > **Required in this object (<code>required</code>):** <a id="dt-cc0174d006ef3c5e35bb"></a> <span id="dt-e3f3f12db06431503a53"><code>&#34;&#35;mux&#45;control&#45;cells&#34;</code></span>
>
> <a id="dt-ca12a4cfa3f7831c4595"></a>
>
> #### Rule 3
>
> > **Required in this object (<code>required</code>):** <a id="dt-1349b2551764b54134c9"></a> <span id="dt-86a34594af6001a89039"><code>&#34;&#35;mux&#45;state&#45;cells&#34;</code></span>

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

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

<a id="dt-5155525ecd924660ec0a"></a>

### <code>&#36;nodename</code> — not listed as required here

**String pattern (<code>pattern</code>):** <span id="dt-0b2111a24a010949ece7"><code>&#34;&#94;mux&#45;controller&#40;&#64;&#46;&#42;&#124;&#45;&#40;&#91;0&#45;9&#93;&#124;&#91;1&#45;9&#93;&#91;0&#45;9&#93;&#43;&#41;&#41;&#63;&#36;&#34;</code></span>

<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

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

**Minimum value (<code>minimum</code>):** <span id="dt-61591a24357f71acbe6b"><code>&#45;2</code></span>

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

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

<div id="dt-3fd07694a9b94e7a29d6">
<p style="white-space: pre-wrap">Mux controller nodes can specify the state the mux should have when it is
idle. If the idle-state is not present, the mux controller is typically
left as is when it is idle. For multiplexer chips that expose several mux
controllers, the idle-state property is an array with one idle state for
each mux controller.</p>
<p style="white-space: pre-wrap">The special value (-1) may be used to indicate that the mux should be left
as is when it is idle. This is the default, but can still be useful for
mux controller chips with more than one mux controller, particularly when
there is a need to "step past" a mux controller and set some other idle
state for a mux controller with a higher index.</p>
<p style="white-space: pre-wrap">Some mux controllers have the ability to disconnect the input/output of the
multiplexer. Using this disconnected high-impedance state as the idle state
is indicated with idle state (-2).</p>
</div>

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

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

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

> **Minimum value (<code>minimum</code>):** <span id="dt-a1234358d968a5c32e46"><code>&#45;2</code></span>

<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;

/* One consumer of a 2-way mux controller (one GPIO-line) */
mux: mux-controller {
    compatible = "gpio-mux";
    #mux-control-cells = &lt;0&gt;;

    mux-gpios = &lt;&amp;pioA 0 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;;
    mux-control-names = "adc";

    channels = "sync", "in";
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;

/*
 * Two consumers (one for an ADC line and one for an i2c bus) of
 * parallel 4-way multiplexers controlled by the same two GPIO-lines.
 */
mux2: 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;mux2&gt;;

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

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

    mux-controls = &lt;&amp;mux2&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>

<pre id="dt-d0212a4cd671f89a0b40"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;

mux1: mux-controller {
    compatible = "gpio-mux";
    #mux-state-cells = &lt;1&gt;;
    mux-gpios = &lt;&amp;exp_som 2 GPIO_ACTIVE_HIGH&gt;;
};

transceiver4: can-phy4 {
    compatible = "ti,tcan1042";
    #phy-cells = &lt;0&gt;;
    max-bitrate = &lt;5000000&gt;;
    standby-gpios = &lt;&amp;exp_som 7 GPIO_ACTIVE_HIGH&gt;;
    mux-states = &lt;&amp;mux1 1&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>

---

# 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>
