xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/nxp,pcf8575.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/nxp,pcf8575.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: PCF857x-compatible I/O expanders
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel Vadotdescription:
135956d97fSEmmanuel Vadot  The PCF857x-compatible chips have "quasi-bidirectional" I/O lines that can be
145956d97fSEmmanuel Vadot  driven high by a pull-up current source or driven low to ground. This
155956d97fSEmmanuel Vadot  combines the direction and output level into a single bit per line, which
165956d97fSEmmanuel Vadot  can't be read back. We can't actually know at initialization time whether a
175956d97fSEmmanuel Vadot  line is configured (a) as output and driving the signal low/high, or (b) as
185956d97fSEmmanuel Vadot  input and reporting a low/high value, without knowing the last value written
195956d97fSEmmanuel Vadot  since the chip came out of reset (if any). The only reliable solution for
205956d97fSEmmanuel Vadot  setting up line direction is thus to do it explicitly.
215956d97fSEmmanuel Vadot
225956d97fSEmmanuel Vadotproperties:
235956d97fSEmmanuel Vadot  compatible:
245956d97fSEmmanuel Vadot    enum:
255956d97fSEmmanuel Vadot      - maxim,max7328
265956d97fSEmmanuel Vadot      - maxim,max7329
275956d97fSEmmanuel Vadot      - nxp,pca8574
285956d97fSEmmanuel Vadot      - nxp,pca8575
295956d97fSEmmanuel Vadot      - nxp,pca9670
305956d97fSEmmanuel Vadot      - nxp,pca9671
315956d97fSEmmanuel Vadot      - nxp,pca9672
325956d97fSEmmanuel Vadot      - nxp,pca9673
335956d97fSEmmanuel Vadot      - nxp,pca9674
345956d97fSEmmanuel Vadot      - nxp,pca9675
355956d97fSEmmanuel Vadot      - nxp,pcf8574
365956d97fSEmmanuel Vadot      - nxp,pcf8574a
375956d97fSEmmanuel Vadot      - nxp,pcf8575
385956d97fSEmmanuel Vadot
395956d97fSEmmanuel Vadot  reg:
405956d97fSEmmanuel Vadot    maxItems: 1
415956d97fSEmmanuel Vadot
42*fac71e4eSEmmanuel Vadot  gpio-line-names:
43*fac71e4eSEmmanuel Vadot    minItems: 1
44*fac71e4eSEmmanuel Vadot    maxItems: 16
45*fac71e4eSEmmanuel Vadot
465956d97fSEmmanuel Vadot  gpio-controller: true
475956d97fSEmmanuel Vadot
485956d97fSEmmanuel Vadot  '#gpio-cells':
495956d97fSEmmanuel Vadot    const: 2
505956d97fSEmmanuel Vadot    description:
515956d97fSEmmanuel Vadot      The first cell is the GPIO number and the second cell specifies GPIO
525956d97fSEmmanuel Vadot      flags, as defined in <dt-bindings/gpio/gpio.h>. Only the GPIO_ACTIVE_HIGH
535956d97fSEmmanuel Vadot      and GPIO_ACTIVE_LOW flags are supported.
545956d97fSEmmanuel Vadot
555956d97fSEmmanuel Vadot  lines-initial-states:
565956d97fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
575956d97fSEmmanuel Vadot    description:
585956d97fSEmmanuel Vadot      Bitmask that specifies the initial state of each line.
595956d97fSEmmanuel Vadot      When a bit is set to zero, the corresponding line will be initialized to
605956d97fSEmmanuel Vadot      the input (pulled-up) state.
615956d97fSEmmanuel Vadot      When the  bit is set to one, the line will be initialized to the
625956d97fSEmmanuel Vadot      low-level output state.
635956d97fSEmmanuel Vadot      If the property is not specified all lines will be initialized to the
645956d97fSEmmanuel Vadot      input state.
655956d97fSEmmanuel Vadot
665956d97fSEmmanuel Vadot  interrupts:
675956d97fSEmmanuel Vadot    maxItems: 1
685956d97fSEmmanuel Vadot
695956d97fSEmmanuel Vadot  interrupt-controller: true
705956d97fSEmmanuel Vadot
715956d97fSEmmanuel Vadot  '#interrupt-cells':
725956d97fSEmmanuel Vadot    const: 2
735956d97fSEmmanuel Vadot
745956d97fSEmmanuel Vadot  wakeup-source: true
755956d97fSEmmanuel Vadot
765956d97fSEmmanuel VadotpatternProperties:
775956d97fSEmmanuel Vadot  "^(.+-hog(-[0-9]+)?)$":
785956d97fSEmmanuel Vadot    type: object
795956d97fSEmmanuel Vadot
805956d97fSEmmanuel Vadot    required:
815956d97fSEmmanuel Vadot      - gpio-hog
825956d97fSEmmanuel Vadot
835956d97fSEmmanuel Vadotrequired:
845956d97fSEmmanuel Vadot  - compatible
855956d97fSEmmanuel Vadot  - reg
865956d97fSEmmanuel Vadot  - gpio-controller
875956d97fSEmmanuel Vadot  - '#gpio-cells'
885956d97fSEmmanuel Vadot
895956d97fSEmmanuel VadotadditionalProperties: false
905956d97fSEmmanuel Vadot
915956d97fSEmmanuel Vadotexamples:
925956d97fSEmmanuel Vadot  - |
935956d97fSEmmanuel Vadot    i2c {
945956d97fSEmmanuel Vadot            #address-cells = <1>;
955956d97fSEmmanuel Vadot            #size-cells = <0>;
965956d97fSEmmanuel Vadot
975956d97fSEmmanuel Vadot            pcf8575: gpio@20 {
985956d97fSEmmanuel Vadot                    compatible = "nxp,pcf8575";
995956d97fSEmmanuel Vadot                    reg = <0x20>;
1005956d97fSEmmanuel Vadot                    interrupt-parent = <&irqpin2>;
1015956d97fSEmmanuel Vadot                    interrupts = <3 0>;
1025956d97fSEmmanuel Vadot                    gpio-controller;
1035956d97fSEmmanuel Vadot                    #gpio-cells = <2>;
1045956d97fSEmmanuel Vadot                    interrupt-controller;
1055956d97fSEmmanuel Vadot                    #interrupt-cells = <2>;
1065956d97fSEmmanuel Vadot            };
1075956d97fSEmmanuel Vadot    };
108