# Spreadtrum SC9860 Pin Controller

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

> Device-tree binding reference for Spreadtrum SC9860 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;sprd&#44;sc9860&#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;Baolin Wang &#60;baolin&#46;wang&#64;linux&#46;alibaba&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<pre><code>The Spreadtrum pin controller are organized in 3 blocks (types).
The first block comprises some global control registers, and each register contains several bit fields with one bit or several bits to configure for some global common configuration, such as domain pad driving level, system control select and so on ("domain pad driving level": One pin can output 3.0v or 1.8v, depending on the related domain pad driving selection, if the related domain pad select 3.0v, then the pin can output 3.0v. "system control" is used to choose one function (like: UART0) for which system, since we have several systems (AP/CP/CM4) on one SoC.).
There are too much various configuration that we can not list all of them, so we can not make every Spreadtrum-special configuration as one generic configuration, and maybe it will add more strange global configuration in future. Then we add one "sprd,control" to set these various global control configuration, and we need use magic number for this property.
Moreover we recognize every fields comprising one bit or several bits in one global control register as one pin, thus we should record every pin's bit offset, bit width and register offset to configure this field (pin).
The second block comprises some common registers which have unified register definition, and each register described one pin is used to configure the pin sleep mode, function select and sleep related configuration.
Now we have 4 systems for sleep mode on SC9860 SoC: AP system, PUBCP system, TGLDSP system and AGDSP system. And the pin sleep related configuration are:
  - input-enable
  - input-disable
  - output-high
  - output-low
  - bias-pull-up
  - bias-pull-down</code></pre>
<p style="white-space: pre-wrap">In some situation we need set the pin sleep mode and pin sleep related configuration, to set the pin sleep related configuration automatically by hardware when the system specified by sleep mode goes into deep sleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP and set the pin sleep related configuration as "input-enable", which means when PUBCP system goes into deep sleep mode, this pin will be set input enable automatically.
Moreover we can not use the "sleep" state, since some systems (like: PUBCP system) do not run linux kernel OS (only AP system run linux kernel on SC9860 platform), then we can not select "sleep" state when the PUBCP system goes into deep sleep mode. Thus we introduce "sprd,sleep-mode" property to set pin sleep mode.
The last block comprises some misc registers which also have unified register definition, and each register described one pin is used to configure drive strength, pull up/down and so on. Especially for pull up, we have two kind pull up resistor: 20K and 4.7K.</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;sprd&#44;sc9860&#45;pinctrl&#34;</code></span>

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

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

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

<a id="dt-738c4b4f9e483441138b"></a>

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

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1d5829f7971aa8b4f354">[<code>&#35;&#47;&#36;defs&#47;pin&#45;node</code>](<#dt-b211b8079281ab542af7>)</span>
>
> <a id="dt-50a89dfb9f4c4d387e7e"></a>
>
> ### Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)
>
> <code>false</code>
>
> Not allowed by this rule.
>
> <a id="dt-861dafa8815d383f13cb"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-0e66c950927664d4a329"></a>
>
> #### <code>function</code> — not listed as required here
>
> <div id="dt-65669ec8e211e31c2268">
> <p style="white-space: pre-wrap">Function to assign to the pins.</p>
> </div>
>
> **Allowed values (<code>enum</code>):** <a id="dt-24d9619532e27dba9ed5"></a> <span id="dt-8d8f20c68960543dc5f1"><code>&#34;func1&#34;</code></span>, <span id="dt-23ff7e75ffe147cae07a"><code>&#34;func2&#34;</code></span>, <span id="dt-f4e6724b6f967c8adec7"><code>&#34;func3&#34;</code></span>, <span id="dt-78a8621978d948c4663f"><code>&#34;func4&#34;</code></span>
>
> <a id="dt-db84d72e37e1245443be"></a>
>
> #### <code>drive&#45;strength</code> — not listed as required here
>
> <div id="dt-9b8873407d69d4321daa">
> <p style="white-space: pre-wrap">Drive strength in mA.</p>
> </div>
>
> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-40d801e63e5035910ac8">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>
>
> **Allowed values (<code>enum</code>):** <a id="dt-68120af82e966d6e1fa3"></a> <span id="dt-6af61d1e0b8feefbf043"><code>2</code></span>, <span id="dt-508145fb1934ce6a48d3"><code>4</code></span>, <span id="dt-1329e1e19e7c9bc6a45b"><code>6</code></span>, <span id="dt-2a77f639f4942f27c8f8"><code>8</code></span>, <span id="dt-59f25a3ef327ae79a0b2"><code>10</code></span>, <span id="dt-5d6089ac2db4650eba8a"><code>12</code></span>, <span id="dt-8bb06ad5f1108aadf4df"><code>14</code></span>, <span id="dt-7258fe7555e9aaa80bce"><code>16</code></span>, <span id="dt-7a4fa2de1ac083a5a83e"><code>20</code></span>, <span id="dt-8e8314a0413bd21cf081"><code>21</code></span>, <span id="dt-11da14b668754d658aa8"><code>24</code></span>, <span id="dt-b695b34b386e318193aa"><code>25</code></span>, <span id="dt-78985a3140bb1a74f9f3"><code>27</code></span>, <span id="dt-4082f44ef366771bd1dd"><code>29</code></span>, <span id="dt-ffc81041e6b23e00739a"><code>31</code></span>, <span id="dt-0991764a8303e7e7c411"><code>33</code></span>
>
> <a id="dt-75d5c5da611df173c6f8"></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-e3976b1dbd4eaf6494cf"></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-4fd7ffdbb7d0e284a77e"></a>
>
> #### <code>bias&#45;pull&#45;up</code> — not listed as required here
>
> **Allowed values (<code>enum</code>):** <a id="dt-a206ecd62ea4bfc30393"></a> <span id="dt-d779f1837fadefa7b699"><code>20000</code></span>, <span id="dt-3c7aeee1a737076e921e"><code>4700</code></span>
>
> <a id="dt-c123955481a53e807670"></a>
>
> #### <code>sprd&#44;sleep&#45;mode</code> — not listed as required here
>
> <div id="dt-e89255cdc0aeed494dc8">
> <p style="white-space: pre-wrap">Pin sleep mode selection.</p>
> </div>
>
> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-3b58b96f488466e797c2">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-a3d4837d929bff9666e5"><code>31</code></span>
>
> <a id="dt-b933049100852a1507a5"></a>
>
> #### <code>sprd&#44;control</code> — not listed as required here
>
> <div id="dt-c8341d379b5d36ac0775">
> <p style="white-space: pre-wrap">Control values referring to databook for global control pins.</p>
> </div>
>
> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-367c7073d103e800bb5c">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>
>
> <a id="dt-23449e149e2279304954"></a>
>
> ### Properties matching a name pattern (<code>patternProperties</code>)
>
> <a id="dt-89cbad95d8446661816e"></a>
>
> #### <code>sleep&#36;</code> — name matches this regular expression
>
> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-04cab006528c1466af86">[<code>&#35;&#47;&#36;defs&#47;pin&#45;node</code>](<#dt-b211b8079281ab542af7>)</span>
>
> <a id="dt-9e87dc467cd0a5f81548"></a>
>
> **Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)**
>
> <code>false</code>
>
> Not allowed by this rule.
>
> <a id="dt-8491b4be5a4c7e1db6de"></a>
>
> **Properties and child nodes (<code>properties</code>)**
>
> <a id="dt-ba417c067c8091939438"></a>
>
> **<code>bias&#45;pull&#45;up</code> — not listed as required here**
>
> **Value type (<code>type</code>):** <span id="dt-5f410192f50fd00a2aa7"><code>&#34;boolean&#34;</code></span>
>
> <a id="dt-a08df12962331c5017c6"></a>
>
> **<code>sleep&#45;hardware&#45;state</code> — not listed as required here**
>
> <div id="dt-cb2d705ea38604b40e39">
> <p style="white-space: pre-wrap">Indicate these configs in sleep related state.</p>
> </div>
>
> **Value type (<code>type</code>):** <span id="dt-1ff5005b347500cac685"><code>&#34;boolean&#34;</code></span>

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

## Reusable definitions (<code>&#36;defs</code>)

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

### <code>pin&#45;node</code>

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

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

#### All of these rules must match (<code>allOf</code>)

<a id="dt-6ea3f54a6746c8fa060a"></a>

**Rule 1**

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

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

**Rule 2**

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

<a id="dt-86bdf01a06484e6c0516"></a>

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

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

**<code>pins</code> — not listed as required here**

<div id="dt-66ebbd6ac80cf9cedae9">
<p style="white-space: pre-wrap">Names of pins to configure.</p>
</div>

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

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

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

<div id="dt-dfd397fb6cf4a15cef16">
<p style="white-space: pre-wrap">Disable pin bias.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-167286397b4d05a71253"><code>&#34;boolean&#34;</code></span>

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

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

<div id="dt-ebf832bfe6ef9900fded">
<p style="white-space: pre-wrap">Pull down on pin.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-4d1e6a62f390976f966c"><code>&#34;boolean&#34;</code></span>

<a id="dt-8928608e024095486130"></a>

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

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

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

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

<div id="dt-6831b1804f6991c1e7c4">
<p style="white-space: pre-wrap">Enable pin input.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-2ff3b3e25eefa893101f"><code>&#34;boolean&#34;</code></span>

<a id="dt-8c9a5612c40119b2ab74"></a>

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

<div id="dt-27c6108714ffb4b6632a">
<p style="white-space: pre-wrap">Enable pin output.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-884dbd1d07e8716cdeaa"><code>&#34;boolean&#34;</code></span>

<a id="dt-6af3f5ff68be5daef190"></a>

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

<div id="dt-4796204225389010db49">
<p style="white-space: pre-wrap">Set the pin as an output level high.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-5cd7e7c135b083e4ada0"><code>&#34;boolean&#34;</code></span>

<a id="dt-6ff3bbacfc338fd95ac5"></a>

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

<div id="dt-1b2039019a7b6fcd6410">
<p style="white-space: pre-wrap">Set the pin as an output level low.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-f188e4951b2e926e7a11"><code>&#34;boolean&#34;</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;reg&#34;</code></span>

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

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">pin_controller: pinctrl@402a0000 {
    compatible = "sprd,sc9860-pinctrl";
    reg = &lt;0x402a0000 0x10000&gt;;

    grp1: sd0 {
        pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE";
        sprd,control = &lt;0x1&gt;;
    };

    grp2: rfctl_33 {
        pins = "SC9860_RFCTL33";
        function = "func2";
        sprd,sleep-mode = &lt;3&gt;;
        grp2_sleep_mode: rfctl_33_sleep {
            pins = "SC9860_RFCTL33";
            sleep-hardware-state;
            output-low;
        };
    };

    grp3: rfctl_misc_20 {
        pins = "SC9860_RFCTL20_MISC";
        drive-strength = &lt;10&gt;;
        bias-pull-up = &lt;4700&gt;;
        grp3_sleep_mode: rfctl_misc_sleep {
            pins = "SC9860_RFCTL20_MISC";
            sleep-hardware-state;
            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>
