# GPIO-based SBU mux

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

> Device-tree binding reference for GPIO-based SBU mux.

<!-- 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;usb&#47;gpio&#45;sbu&#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;Bjorn Andersson &#60;andersson&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">In USB Type-C applications the SBU lines needs to be connected, disconnected and swapped depending on the altmode and orientation. This binding describes a family of hardware solutions which switches between these modes using GPIO signals.</p>
</div>

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

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

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

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

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

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

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

**Item 1**

> **Allowed values (<code>enum</code>):** <a id="dt-851ace07a50c83495949"></a> <span id="dt-63b688f2ccd82724cb8f"><code>&#34;nxp&#44;cbdtu02043&#34;</code></span>, <span id="dt-2d97ae0f34d14dd8e72b"><code>&#34;onnn&#44;fsusb42&#34;</code></span>, <span id="dt-9802844ed4869452d348"><code>&#34;onnn&#44;fsusb43l10x&#34;</code></span>, <span id="dt-24a1253e29125294194d"><code>&#34;pericom&#44;pi3usb102&#34;</code></span>, <span id="dt-6eb9cf2b3f55b257fde4"><code>&#34;ti&#44;tmuxhs4212&#34;</code></span>

<a id="dt-0891c69625632ea817fd"></a>

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-f1f862a3cfab3ac620c8"><code>&#34;gpio&#45;sbu&#45;mux&#34;</code></span>

<a id="dt-0d068058a6f4b36b1505"></a>

### <code>enable&#45;gpios</code> — not listed as required here

<div id="dt-2169b15d9fc9d03c1e0f">
<p style="white-space: pre-wrap">Switch enable GPIO</p>
</div>

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

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

<div id="dt-2f3f6dd18133031c14cf">
<p style="white-space: pre-wrap">Orientation select</p>
</div>

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

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

<div id="dt-304923183fea32e69a40">
<p style="white-space: pre-wrap">power supply</p>
</div>

<a id="dt-1a0a9be7d99d9096f05a"></a>

### <code>mode&#45;switch</code> — not listed as required here

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

<a id="dt-8459239d22594ac44b38"></a>

### <code>orientation&#45;switch</code> — required here

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

<a id="dt-1d845f0617b4072cef77"></a>

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1ed24d3512fbe8ce2017">[<code>&#47;schemas&#47;graph&#46;yaml&#35;&#47;properties&#47;port</code>](</kernel/hardware/devicetree-bindings/dt-shared/graph.md#dt-1d845f0617b4072cef77>)</span>

<div id="dt-0cd71b006a1fcbec8daa">
<p style="white-space: pre-wrap">A port node to link the SBU mux to a TypeC controller for the purpose of handling altmode muxing and orientation switching.</p>
</div>

**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;select&#45;gpios&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;orientation&#45;switch&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;port&#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>usb&#45;switch&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-usb/usb-switch.md#dt-root>)</span>

<a id="dt-22ca5ec5b89308748ecc"></a>

### Rule 2

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-8549616abc3b04702c51">[<code>usb&#45;switch&#45;ports&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-usb/usb-switch-ports.md#dt-root>)</span>

<a id="dt-317510ea5c8bf789ca60"></a>

### Rule 3

> <a id="dt-15ef78abba37234c7e3a"></a>
>
> #### Condition (<code>if</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-6cd59169876f78b3673d"></a> <span id="dt-6e9be25c995eaf8168d1"><code>&#34;mode&#45;switch&#34;</code></span>
>
> <a id="dt-86c371e5831ff1f84ce5"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-caec4da91c2837148d80"></a> <span id="dt-aa785038ee05bfb1e067"><code>&#34;enable&#45;gpios&#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;

tcpm {
    connector {
        compatible = "usb-c-connector";

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

            port@0 {
                reg = &lt;0&gt;;
                tcpm_hs_out: endpoint {
                    remote-endpoint = &lt;&amp;usb_hs_phy_in&gt;;
                };
            };

            port@1 {
                reg = &lt;1&gt;;
                tcpm_ss_out: endpoint {
                    remote-endpoint = &lt;&amp;usb_ss_phy_in&gt;;
                };
            };

            port@2 {
                reg = &lt;2&gt;;
                tcpm_sbu_out: endpoint {
                    remote-endpoint = &lt;&amp;sbu_mux_in&gt;;
                };
            };
        };
    };
};

sbu-mux {
    compatible = "pericom,pi3usb102", "gpio-sbu-mux";

    enable-gpios = &lt;&amp;tlmm 101 GPIO_ACTIVE_LOW&gt;;
    select-gpios = &lt;&amp;tlmm 164 GPIO_ACTIVE_HIGH&gt;;

    mode-switch;
    orientation-switch;

    port {
        sbu_mux_in: endpoint {
            remote-endpoint = &lt;&amp;tcpm_sbu_out&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-only OR BSD-2-Clause</span></p>

</details>
