# PCF857x-compatible I/O expanders

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

> Device-tree binding reference for PCF857x-compatible I/O expanders.

<!-- 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;gpio&#47;nxp&#44;pcf8575&#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;Laurent Pinchart &#60;laurent&#46;pinchart&#43;renesas&#64;ideasonboard&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be driven high by a pull-up current source or driven low to ground. This combines the direction and output level into a single bit per line, which can't be read back. We can't actually know at initialization time whether a line is configured (a) as output and driving the signal low/high, or (b) as input and reporting a low/high value, without knowing the last value written since the chip came out of reset (if any). The only reliable solution for setting up line direction is thus to do it explicitly.</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;maxim&#44;max7328&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;maxim&#44;max7329&#34;</code></span>, <span id="dt-88ff8a31b3bd20d1ddec"><code>&#34;nxp&#44;pca8574&#34;</code></span>, <span id="dt-76b67e65b51f033b1109"><code>&#34;nxp&#44;pca8575&#34;</code></span>, <span id="dt-498d24c42855e222b0fd"><code>&#34;nxp&#44;pca9670&#34;</code></span>, <span id="dt-216696827b315708886c"><code>&#34;nxp&#44;pca9671&#34;</code></span>, <span id="dt-5708aa713f48e19e156f"><code>&#34;nxp&#44;pca9672&#34;</code></span>, <span id="dt-3edbd20dc5b59e47edf5"><code>&#34;nxp&#44;pca9673&#34;</code></span>, <span id="dt-07feb33463d5c114ab05"><code>&#34;nxp&#44;pca9674&#34;</code></span>, <span id="dt-1e634b71c3167df349bb"><code>&#34;nxp&#44;pca9675&#34;</code></span>, <span id="dt-70e866729f00cfce3510"><code>&#34;nxp&#44;pcf8574&#34;</code></span>, <span id="dt-81f973819a6dd2302321"><code>&#34;nxp&#44;pcf8574a&#34;</code></span>, <span id="dt-e5cbf931a6c5d40231a9"><code>&#34;nxp&#44;pcf8575&#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-14035f3a8826cdac18bd"></a>

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

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-d7da1f39f1fcedec6860"><code>16</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">The first cell is the GPIO number and the second cell specifies GPIO flags, as defined in &lt;dt-bindings/gpio/gpio.h&gt;. Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.</p>
</div>

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

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

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

<div id="dt-f9efed7b192d329596f7">
<p style="white-space: pre-wrap">Bitmask that specifies the initial state of each line. When a bit is set to zero, the corresponding line will be initialized to the input (pulled-up) state. When the  bit is set to one, the line will be initialized to the low-level output state. If the property is not specified all lines will be initialized to the input state.</p>
</div>

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

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

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

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

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

### <code>wakeup&#45;source</code> — not listed as required here

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

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

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

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

<div id="dt-451564af2b6998692dea">
<p style="white-space: pre-wrap">GPIO controlling the (reset active LOW) RESET# pin.
The active polarity of the GPIO must translate to the low state of the RESET# pin on the IC, i.e. if a GPIO is directly routed to the RESET# pin without any inverter, GPIO_ACTIVE_LOW is expected.
Performing a reset makes all lines initialized to their input (pulled-up) state.</p>
</div>

<a id="dt-935ee547587f3e75de61"></a>

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

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

### Rule 1

> <a id="dt-3bbb54dfa1f05dfb4d25"></a>
>
> #### Condition (<code>if</code>)
>
> > <a id="dt-97f47e9dc804c839f86d"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-bbadeeb73dfaefabae79"></a>
> >
> > **<code>compatible</code> — not listed as required here**
> >
> > <a id="dt-bf9d7a6c36fc19e6cd0a"></a>
> >
> > **This rule must not match (<code>not</code>)**
> >
> > > <a id="dt-451f8454a4f96d20fdd9"></a>
> > >
> > > **Rule for matching array elements (<code>contains</code>)**
> > >
> > > > **Allowed values (<code>enum</code>):** <a id="dt-b0443397560b968195b8"></a> <span id="dt-eee805568886c3c0f483"><code>&#34;nxp&#44;pca9670&#34;</code></span>, <span id="dt-db8973c13f1a89db260a"><code>&#34;nxp&#44;pca9671&#34;</code></span>, <span id="dt-5867a4059d130044db8c"><code>&#34;nxp&#44;pca9672&#34;</code></span>, <span id="dt-3ce27c0a9eaf0b6688a2"><code>&#34;nxp&#44;pca9673&#34;</code></span>
>
> <a id="dt-1ba25143802b75b74702"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-b212c2ef78c22fab2e20"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-a7d7e9bb152e9982ff34"></a>
> >
> > **<code>reset&#45;gpios</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

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

### Rule 2

> <a id="dt-ffbf5afb799d5f07b3e1"></a>
>
> #### Condition (<code>if</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-5f135e3db8ef1aa53700"></a> <span id="dt-0164887f025a095456fa"><code>&#34;lines&#45;initial&#45;states&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > <a id="dt-26d1c84fcc55a7d91dea"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-398076edceb8f164a46e"></a>
> >
> > **<code>reset&#45;gpios</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

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

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

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

### <code>&#94;&#40;&#46;&#43;&#45;hog&#40;&#45;&#91;0&#45;9&#93;&#43;&#41;&#63;&#41;&#36;</code> — name matches this regular expression

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

**Required in this object (<code>required</code>):** <a id="dt-60f24b032382c79d795e"></a> <span id="dt-a3e4a723e048081b8fe8"><code>&#34;gpio&#45;hog&#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>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;gpio&#45;controller&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;&#35;gpio&#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">i2c {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    gpio@20 {
        compatible = "nxp,pcf8575";
        reg = &lt;0x20&gt;;
        interrupt-parent = &lt;&amp;irqpin2&gt;;
        interrupts = &lt;3 0&gt;;
        gpio-controller;
        #gpio-cells = &lt;2&gt;;
        interrupt-controller;
        #interrupt-cells = &lt;2&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>

<p id="dt-comment-1"><strong>Line 103:</strong> <span> lines-initial-states XOR reset-gpios</span></p>

<p id="dt-comment-2"><strong>Line 104:</strong> <span> Performing a reset reinitializes all lines to a known state which</span></p>

<p id="dt-comment-3"><strong>Line 105:</strong> <span> may not match passed lines-initial-states</span></p>

</details>
