xref: /linux/Documentation/devicetree/bindings/pinctrl/cypress,cy8c95x0.yaml (revision 8e4cc358223df13c8842e9a71961a00d0652f341)
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    minItems: 1
49    maxItems: 60
50
51  vdd-supply:
52    description:
53      Optional power supply.
54
55  reset-gpios:
56    description: GPIO connected to the XRES pin
57    maxItems: 1
58
59patternProperties:
60  '-pins$':
61    type: object
62    description:
63      Pinctrl node's client devices use subnodes for desired pin configuration.
64      Client device subnodes use below standard properties.
65    $ref: pincfg-node.yaml#
66
67    properties:
68      pins:
69        description:
70          List of gpio pins affected by the properties specified in this
71          subnode.
72        items:
73          pattern: '^gp([0-7][0-7])$'
74        minItems: 1
75        maxItems: 60
76
77      function:
78        description:
79          Specify the alternative function to be configured for the specified
80          pins.
81        enum: [ gpio, pwm ]
82
83      bias-pull-down: true
84
85      bias-pull-up: true
86
87      bias-disable: true
88
89      input-enable: true
90
91      output-high: true
92
93      output-low: true
94
95      drive-push-pull: true
96
97      drive-open-drain: true
98
99      drive-open-source: true
100
101    required:
102      - pins
103      - function
104
105    additionalProperties: false
106
107required:
108  - compatible
109  - reg
110  - interrupts
111  - interrupt-controller
112  - '#interrupt-cells'
113  - gpio-controller
114  - '#gpio-cells'
115
116additionalProperties: false
117
118allOf:
119  - $ref: pinctrl.yaml#
120
121examples:
122  - |
123    #include <dt-bindings/interrupt-controller/arm-gic.h>
124    #include <dt-bindings/interrupt-controller/irq.h>
125
126    i2c {
127      #address-cells = <1>;
128      #size-cells = <0>;
129
130      pinctrl@20 {
131        compatible = "cypress,cy8c9520";
132        reg = <0x20>;
133        gpio-controller;
134        #gpio-cells = <2>;
135        #interrupt-cells = <2>;
136        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
137        interrupt-controller;
138        vdd-supply = <&p3v3>;
139        gpio-reserved-ranges = <1 2>, <6 1>, <10 1>, <15 1>;
140
141        pinctrl-0 = <&U62160_pins>, <&U62160_ipins>;
142        pinctrl-names = "default";
143
144        U62160_pins: cfg-pins {
145          pins = "gp03", "gp16", "gp20", "gp50", "gp51";
146          function = "gpio";
147          input-enable;
148          bias-pull-up;
149        };
150
151        U62160_ipins: icfg-pins {
152          pins = "gp04", "gp17", "gp21", "gp52", "gp53";
153          function = "gpio";
154          input-enable;
155          bias-pull-up;
156        };
157      };
158    };
159