PCF857x-compatible I/O expanders
Schema identifier ($id): "http://devicetree.org/schemas/gpio/nxp,pcf8575.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>"
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.
Properties and child nodes (properties) #
compatible — required here #
Allowed values (enum): "maxim,max7328", "maxim,max7329", "nxp,pca8574", "nxp,pca8575", "nxp,pca9670", "nxp,pca9671", "nxp,pca9672", "nxp,pca9673", "nxp,pca9674", "nxp,pca9675", "nxp,pcf8574", "nxp,pcf8574a", "nxp,pcf8575"
reg — required here #
Maximum number of items (maxItems): 1
gpio-line-names — not listed as required here #
Minimum number of items (minItems): 1
Maximum number of items (maxItems): 16
gpio-controller — required here #
true — No constraints added by this property rule.
#gpio-cells — required here #
Exact value (const): 2
The first cell is the GPIO number and the second cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
lines-initial-states — not listed as required here #
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
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.
interrupts — not listed as required here #
Maximum number of items (maxItems): 1
interrupt-controller — not listed as required here #
true — No constraints added by this property rule.
#interrupt-cells — not listed as required here #
Exact value (const): 2
wakeup-source — not listed as required here #
true — No constraints added by this property rule.
reset-gpios — not listed as required here #
Maximum number of items (maxItems): 1
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.
All of these rules must match (allOf) #
Rule 1 #
Condition (
if) #Properties and child nodes (
properties)
compatible— not listed as required hereThis rule must not match (
not)Rule for matching array elements (
contains)Allowed values (
enum):"nxp,pca9670","nxp,pca9671","nxp,pca9672","nxp,pca9673"When the condition matches (
then) #Properties and child nodes (
properties)
reset-gpios— not listed as required here
false— Not permitted by this property rule.
Rule 2 #
Condition (
if) #When the condition matches (
then) #Properties and child nodes (
properties)
reset-gpios— not listed as required here
false— Not permitted by this property rule.
Properties matching a name pattern (patternProperties) #
^(.+-hog(-[0-9]+)?)$ — name matches this regular expression #
Value type (type): "object"
Required in this object (required): "gpio-hog"
Required in this object (required): "compatible", "reg", "gpio-controller", "#gpio-cells"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Examples (examples) #
i2c {
#address-cells = <1>;
#size-cells = <0>;
gpio@20 {
compatible = "nxp,pcf8575";
reg = <0x20>;
interrupt-parent = <&irqpin2>;
interrupts = <3 0>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
Line 103: lines-initial-states XOR reset-gpios
Line 104: Performing a reset reinitializes all lines to a known state which
Line 105: may not match passed lines-initial-states