xref: /linux/Documentation/devicetree/bindings/gpio/aspeed,ast2400-gpio.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/aspeed,ast2400-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Aspeed GPIO controller
8
9maintainers:
10  - Andrew Jeffery <andrew@codeconstruct.com.au>
11
12properties:
13  compatible:
14    enum:
15      - aspeed,ast2400-gpio
16      - aspeed,ast2500-gpio
17      - aspeed,ast2600-gpio
18      - aspeed,ast2700-gpio
19
20  reg:
21    maxItems: 1
22
23  clocks:
24    maxItems: 1
25    description: The clock to use for debounce timings
26
27  gpio-controller: true
28  gpio-line-names:
29    minItems: 12
30    maxItems: 232
31
32  gpio-ranges: true
33
34  "#gpio-cells":
35    const: 2
36
37  interrupts:
38    maxItems: 1
39
40  interrupt-controller: true
41
42  "#interrupt-cells":
43    const: 2
44
45  ngpios:
46    minimum: 12
47    maximum: 232
48
49required:
50  - compatible
51  - reg
52  - interrupts
53  - interrupt-controller
54  - "#interrupt-cells"
55  - gpio-controller
56  - "#gpio-cells"
57
58allOf:
59  - if:
60      properties:
61        compatible:
62          contains:
63            const: aspeed,ast2400-gpio
64    then:
65      properties:
66        gpio-line-names:
67          minItems: 220
68          maxItems: 220
69        ngpios:
70          const: 220
71  - if:
72      properties:
73        compatible:
74          contains:
75            const: aspeed,ast2500-gpio
76    then:
77      properties:
78        gpio-line-names:
79          minItems: 232
80          maxItems: 232
81        ngpios:
82          const: 232
83  - if:
84      properties:
85        compatible:
86          contains:
87            const: aspeed,ast2600-gpio
88    then:
89      properties:
90        gpio-line-names:
91          minItems: 36
92          maxItems: 208
93        ngpios:
94          enum: [ 36, 208 ]
95      required:
96        - ngpios
97  - if:
98      properties:
99        compatible:
100          contains:
101            const: aspeed,ast2700-gpio
102    then:
103      properties:
104        gpio-line-names:
105          minItems: 12
106          maxItems: 216
107        ngpios:
108          enum: [ 12, 216 ]
109      required:
110        - ngpios
111
112additionalProperties: false
113
114examples:
115  - |
116    gpio@1e780000 {
117        compatible = "aspeed,ast2400-gpio";
118        reg = <0x1e780000 0x1000>;
119        interrupts = <20>;
120        interrupt-controller;
121        #interrupt-cells = <2>;
122        gpio-controller;
123        #gpio-cells = <2>;
124    };
125  - |
126    gpio: gpio@1e780000 {
127        compatible = "aspeed,ast2500-gpio";
128        reg = <0x1e780000 0x200>;
129        interrupts = <20>;
130        interrupt-controller;
131        #interrupt-cells = <2>;
132        gpio-controller;
133        #gpio-cells = <2>;
134        gpio-ranges = <&pinctrl 0 0 232>;
135    };
136  - |
137    #include <dt-bindings/clock/ast2600-clock.h>
138    #include <dt-bindings/interrupt-controller/arm-gic.h>
139    #include <dt-bindings/interrupt-controller/irq.h>
140    gpio0: gpio@1e780000 {
141        compatible = "aspeed,ast2600-gpio";
142        reg = <0x1e780000 0x400>;
143        clocks = <&syscon ASPEED_CLK_APB2>;
144        interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
145        interrupt-controller;
146        #interrupt-cells = <2>;
147        #gpio-cells = <2>;
148        gpio-controller;
149        gpio-ranges = <&pinctrl 0 0 208>;
150        ngpios = <208>;
151    };
152    gpio1: gpio@1e780800 {
153        compatible = "aspeed,ast2600-gpio";
154        reg = <0x1e780800 0x800>;
155        clocks = <&syscon ASPEED_CLK_APB1>;
156        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
157        interrupt-controller;
158        #interrupt-cells = <2>;
159        gpio-controller;
160        #gpio-cells = <2>;
161        gpio-ranges = <&pinctrl 0 208 36>;
162        ngpios = <36>;
163    };
164