# MediaTek MT65xx Pin Controller

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

> Device-tree binding reference for MediaTek MT65xx Pin Controller.

<!-- 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;pinctrl&#47;mediatek&#44;mt65xx&#45;pinctrl&#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;Sean Wang &#60;sean&#46;wang&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The MediaTek's MT65xx Pin controller is used to control SoC pins.</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;mediatek&#44;mt2701&#45;pinctrl&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;mediatek&#44;mt2712&#45;pinctrl&#34;</code></span>, <span id="dt-88ff8a31b3bd20d1ddec"><code>&#34;mediatek&#44;mt6397&#45;pinctrl&#34;</code></span>, <span id="dt-76b67e65b51f033b1109"><code>&#34;mediatek&#44;mt7623&#45;pinctrl&#34;</code></span>, <span id="dt-498d24c42855e222b0fd"><code>&#34;mediatek&#44;mt8127&#45;pinctrl&#34;</code></span>, <span id="dt-216696827b315708886c"><code>&#34;mediatek&#44;mt8135&#45;pinctrl&#34;</code></span>, <span id="dt-5708aa713f48e19e156f"><code>&#34;mediatek&#44;mt8167&#45;pinctrl&#34;</code></span>, <span id="dt-3edbd20dc5b59e47edf5"><code>&#34;mediatek&#44;mt8173&#45;pinctrl&#34;</code></span>, <span id="dt-07feb33463d5c114ab05"><code>&#34;mediatek&#44;mt8516&#45;pinctrl&#34;</code></span>

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

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-71421d35675d9a533ad2"><code>1</code></span>

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

### <code>pins&#45;are&#45;numbered</code> — not listed as required here

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

<div id="dt-f6f8c802a8df9ffa75d0">
<p style="white-space: pre-wrap">Specify the subnodes are using numbered pinmux to specify pins. (UNUSED)</p>
</div>

**Deprecated (<code>deprecated</code>):** <span id="dt-6863cfd96bfde27d76b8"><code>true</code></span>

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

### <code>gpio&#45;controller</code> — required here

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

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

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

**Exact value (<code>const</code>):** <span id="dt-8950f722147d2cd640b8"><code>2</code></span>

<div id="dt-70b20397c3c73794f833">
<p style="white-space: pre-wrap">Number of cells in GPIO specifier. Since the generic GPIO binding is used, the amount of cells must be specified as 2. See the below mentioned gpio binding representation for description of particular cells.</p>
</div>

<a id="dt-14035f3a8826cdac18bd"></a>

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

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

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

### <code>mediatek&#44;pctl&#45;regmap</code> — not listed as required here

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

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

> **Maximum number of items (<code>maxItems</code>):** <span id="dt-14cb292c1dd921fa1b80"><code>1</code></span>

**Minimum number of items (<code>minItems</code>):** <span id="dt-4a95d7acfedcc998ef61"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-edc3ecc0f88792db37e2"><code>2</code></span>

<div id="dt-98fae7654371e6d6d973">
<p style="white-space: pre-wrap">Should be phandles of the syscfg node.</p>
</div>

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

### <code>interrupt&#45;controller</code> — not listed as required here

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

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

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

**Minimum number of items (<code>minItems</code>):** <span id="dt-1691b9edf145244244a0"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b7823fb65b2f27642d26"><code>3</code></span>

<a id="dt-8586fac2d9a71adf4795"></a>

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

**Exact value (<code>const</code>):** <span id="dt-317bbf786489389e8233"><code>2</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;gpio&#45;controller&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;&#35;gpio&#45;cells&#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>pinctrl&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pinctrl.md#dt-root>)</span>

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

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-7215d3491c6d4146f478"></a>

### <code>pins&#36;</code> — name matches this regular expression

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

<a id="dt-0280eaa837c80354da4f"></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-25d0be1559352a77169d"></a>

#### Properties matching a name pattern (<code>patternProperties</code>)

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

**<code>&#40;&#94;pins&#124;pins&#63;&#36;&#41;</code> — name matches this regular expression**

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

<a id="dt-810edfa496a62760fadb"></a>

**Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)**

<code>false</code>

Not allowed by this rule.

<div id="dt-a16a48fd863f12282eed">
<p style="white-space: pre-wrap">A pinctrl node should contain at least one subnodes representing the pinctrl groups available on the machine. Each subnode will list the pins it needs, and how they should be configured, with regard to muxer configuration, pullups, drive strength, input enable/disable and input schmitt.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-ac622511fa9fd24a4703">[<code>&#47;schemas&#47;pinctrl&#47;pincfg&#45;node&#46;yaml</code>](</kernel/hardware/devicetree-bindings/dt-pinctrl/pincfg-node.md#dt-root>)</span>

<a id="dt-99241f02fc89c0b59079"></a>

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

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

**<code>pinmux</code> — required here**

<div id="dt-6e45179f62e7561d6144">
<p style="white-space: pre-wrap">Integer array, represents gpio pin number and mux setting. Supported pin number and mux varies for different SoCs, and are defined as macros in dt-bindings/pinctrl/&lt;soc&gt;-pinfunc.h directly.</p>
</div>

<a id="dt-868c73e5c1e4d58c015e"></a>

**<code>bias&#45;disable</code> — not listed as required here**

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

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

**<code>bias&#45;pull&#45;up</code> — not listed as required here**

<div id="dt-ddc536a6dffafa01ee93">
<p style="white-space: pre-wrap">Besides generic pinconfig options, it can be used as the pull up settings for 2 pull resistors, R0 and R1. User can configure those special pins. Some macros have been defined for this usage, such as MTK_PUPD_SET_R1R0_00. See dt-bindings/pinctrl/mt65xx.h for valid arguments.</p>
</div>

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

**<code>bias&#45;pull&#45;down</code> — not listed as required here**

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

<a id="dt-08c130c6034bebbe5162"></a>

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

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

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

**<code>input&#45;disable</code> — not listed as required here**

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

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

**<code>output&#45;low</code> — not listed as required here**

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

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

**<code>output&#45;high</code> — not listed as required here**

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

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

**<code>input&#45;schmitt&#45;enable</code> — not listed as required here**

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

<a id="dt-85c957e756cf66abc6dc"></a>

**<code>input&#45;schmitt&#45;disable</code> — not listed as required here**

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

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

**<code>drive&#45;strength</code> — not listed as required here**

<div id="dt-dbc1e232de859e783684">
<p style="white-space: pre-wrap">Can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA, etc. See dt-bindings/pinctrl/mt65xx.h for valid arguments.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-750292d28256f0d24b4e"></a> <span id="dt-ecc45bc1c5b4b0e199e8"><code>&#34;pinmux&#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/interrupt-controller/irq.h&gt;
#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/pinctrl/mt8135-pinfunc.h&gt;

soc {
    #address-cells = &lt;2&gt;;
    #size-cells = &lt;2&gt;;

    pinctrl@1c20800 {
        compatible = "mediatek,mt8135-pinctrl";
        reg = &lt;0 0x1000B000 0 0x1000&gt;;
        mediatek,pctl-regmap = &lt;&amp;syscfg_pctl_a&gt;, &lt;&amp;syscfg_pctl_b&gt;;
        gpio-controller;
        #gpio-cells = &lt;2&gt;;
        interrupt-controller;
        #interrupt-cells = &lt;2&gt;;
        interrupts = &lt;GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH&gt;,
                     &lt;GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH&gt;,
                     &lt;GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH&gt;;

        i2c0_pins_a: i2c0-pins {
            pins1 {
                pinmux = &lt;MT8135_PIN_100_SDA0__FUNC_SDA0&gt;,
                         &lt;MT8135_PIN_101_SCL0__FUNC_SCL0&gt;;
                bias-disable;
            };
        };

        i2c1_pins_a: i2c1-pins {
            pins {
                pinmux = &lt;MT8135_PIN_195_SDA1__FUNC_SDA1&gt;,
                         &lt;MT8135_PIN_196_SCL1__FUNC_SCL1&gt;;
                bias-pull-up = &lt;MTK_PUPD_SET_R1R0_01&gt;;
            };
        };

        i2c2_pins_a: i2c2-pins {
            pins1 {
                pinmux = &lt;MT8135_PIN_193_SDA2__FUNC_SDA2&gt;;
                bias-pull-down;
            };

            pins2 {
                pinmux = &lt;MT8135_PIN_49_WATCHDOG__FUNC_GPIO49&gt;;
                bias-pull-up;
            };
        };
    };
};
</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>
