1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pinctrl/cypress,cy8c95x0.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cypress CY8C95X0 I2C GPIO expander
8
9maintainers:
10  - Patrick Rudolph <patrick.rudolph@9elements.com>
11
12description: |
13  This supports the 20/40/60 pin Cypress CYC95x0 GPIO I2C expanders.
14  Pin function configuration is performed on a per-pin basis.
15
16properties:
17  compatible:
18    enum:
19      - cypress,cy8c9520
20      - cypress,cy8c9540
21      - cypress,cy8c9560
22
23  reg:
24    maxItems: 1
25
26  gpio-controller: true
27
28  '#gpio-cells':
29    description:
30      The first cell is the GPIO number and the second cell specifies GPIO
31      flags, as defined in <dt-bindings/gpio/gpio.h>.
32    const: 2
33
34  interrupts:
35    maxItems: 1
36
37  interrupt-controller: true
38
39  '#interrupt-cells':
40    const: 2
41
42  gpio-line-names: true
43
44  gpio-ranges:
45    maxItems: 1
46
47  gpio-reserved-ranges:
48    maxItems: 1
49
50  vdd-supply:
51    description:
52      Optional power supply.
53
54patternProperties:
55  '-pins$':
56    type: object
57    description:
58      Pinctrl node's client devices use subnodes for desired pin configuration.
59      Client device subnodes use below standard properties.
60    $ref: pincfg-node.yaml#
61
62    properties:
63      pins:
64        description:
65          List of gpio pins affected by the properties specified in this
66          subnode.
67        items:
68          pattern: '^gp([0-7][0-7])$'
69        minItems: 1
70        maxItems: 60
71
72      function:
73        description:
74          Specify the alternative function to be configured for the specified
75          pins.
76        enum: [ gpio, pwm ]
77
78      bias-pull-down: true
79
80      bias-pull-up: true
81
82      bias-disable: true
83
84      output-high: true
85
86      output-low: true
87
88      drive-push-pull: true
89
90      drive-open-drain: true
91
92      drive-open-source: true
93
94    required:
95      - pins
96      - function
97
98    additionalProperties: false
99
100required:
101  - compatible
102  - reg
103  - interrupts
104  - interrupt-controller
105  - '#interrupt-cells'
106  - gpio-controller
107  - '#gpio-cells'
108
109additionalProperties: false
110
111allOf:
112  - $ref: "pinctrl.yaml#"
113
114examples:
115  - |
116    #include <dt-bindings/interrupt-controller/arm-gic.h>
117    #include <dt-bindings/interrupt-controller/irq.h>
118
119    i2c {
120      #address-cells = <1>;
121      #size-cells = <0>;
122
123      pinctrl@20 {
124        compatible = "cypress,cy8c9520";
125        reg = <0x20>;
126        gpio-controller;
127        #gpio-cells = <2>;
128        #interrupt-cells = <2>;
129        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
130        interrupt-controller;
131        vdd-supply = <&p3v3>;
132        gpio-reserved-ranges = <5 1>;
133      };
134    };
135