xref: /linux/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/loongson,ls-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Loongson GPIO controller.
8
9maintainers:
10  - Yinbo Zhu <zhuyinbo@loongson.cn>
11
12properties:
13  compatible:
14    enum:
15      - loongson,ls2k-gpio
16      - loongson,ls7a-gpio
17
18  reg:
19    maxItems: 1
20
21  ngpios:
22    minimum: 1
23    maximum: 64
24
25  "#gpio-cells":
26    const: 2
27
28  gpio-controller: true
29
30  gpio-ranges: true
31
32  interrupts:
33    minItems: 1
34    maxItems: 64
35
36required:
37  - compatible
38  - reg
39  - ngpios
40  - "#gpio-cells"
41  - gpio-controller
42  - gpio-ranges
43  - interrupts
44
45additionalProperties: false
46
47examples:
48  - |
49    #include <dt-bindings/interrupt-controller/irq.h>
50
51    gpio0: gpio@1fe00500 {
52      compatible = "loongson,ls2k-gpio";
53      reg = <0x1fe00500 0x38>;
54      ngpios = <64>;
55      #gpio-cells = <2>;
56      gpio-controller;
57      gpio-ranges = <&pctrl 0 0 15>,
58                    <&pctrl 16 16 15>,
59                    <&pctrl 32 32 10>,
60                    <&pctrl 44 44 20>;
61      interrupt-parent = <&liointc1>;
62      interrupts = <28 IRQ_TYPE_LEVEL_LOW>,
63                   <29 IRQ_TYPE_LEVEL_LOW>,
64                   <30 IRQ_TYPE_LEVEL_LOW>,
65                   <30 IRQ_TYPE_LEVEL_LOW>,
66                   <26 IRQ_TYPE_LEVEL_LOW>,
67                   <26 IRQ_TYPE_LEVEL_LOW>,
68                   <26 IRQ_TYPE_LEVEL_LOW>,
69                   <26 IRQ_TYPE_LEVEL_LOW>,
70                   <26 IRQ_TYPE_LEVEL_LOW>,
71                   <26 IRQ_TYPE_LEVEL_LOW>,
72                   <26 IRQ_TYPE_LEVEL_LOW>,
73                   <26 IRQ_TYPE_LEVEL_LOW>,
74                   <26 IRQ_TYPE_LEVEL_LOW>,
75                   <26 IRQ_TYPE_LEVEL_LOW>,
76                   <26 IRQ_TYPE_LEVEL_LOW>,
77                   <>,
78                   <26 IRQ_TYPE_LEVEL_LOW>,
79                   <26 IRQ_TYPE_LEVEL_LOW>,
80                   <26 IRQ_TYPE_LEVEL_LOW>,
81                   <26 IRQ_TYPE_LEVEL_LOW>,
82                   <26 IRQ_TYPE_LEVEL_LOW>,
83                   <26 IRQ_TYPE_LEVEL_LOW>,
84                   <26 IRQ_TYPE_LEVEL_LOW>,
85                   <26 IRQ_TYPE_LEVEL_LOW>,
86                   <26 IRQ_TYPE_LEVEL_LOW>,
87                   <26 IRQ_TYPE_LEVEL_LOW>,
88                   <26 IRQ_TYPE_LEVEL_LOW>,
89                   <26 IRQ_TYPE_LEVEL_LOW>,
90                   <26 IRQ_TYPE_LEVEL_LOW>,
91                   <26 IRQ_TYPE_LEVEL_LOW>,
92                   <26 IRQ_TYPE_LEVEL_LOW>,
93                   <26 IRQ_TYPE_LEVEL_LOW>,
94                   <27 IRQ_TYPE_LEVEL_LOW>,
95                   <27 IRQ_TYPE_LEVEL_LOW>,
96                   <27 IRQ_TYPE_LEVEL_LOW>,
97                   <27 IRQ_TYPE_LEVEL_LOW>,
98                   <27 IRQ_TYPE_LEVEL_LOW>,
99                   <>,
100                   <27 IRQ_TYPE_LEVEL_LOW>,
101                   <27 IRQ_TYPE_LEVEL_LOW>,
102                   <27 IRQ_TYPE_LEVEL_LOW>,
103                   <27 IRQ_TYPE_LEVEL_LOW>,
104                   <>,
105                   <>,
106                   <27 IRQ_TYPE_LEVEL_LOW>,
107                   <27 IRQ_TYPE_LEVEL_LOW>,
108                   <27 IRQ_TYPE_LEVEL_LOW>,
109                   <27 IRQ_TYPE_LEVEL_LOW>,
110                   <27 IRQ_TYPE_LEVEL_LOW>,
111                   <27 IRQ_TYPE_LEVEL_LOW>,
112                   <27 IRQ_TYPE_LEVEL_LOW>,
113                   <27 IRQ_TYPE_LEVEL_LOW>,
114                   <27 IRQ_TYPE_LEVEL_LOW>,
115                   <27 IRQ_TYPE_LEVEL_LOW>,
116                   <27 IRQ_TYPE_LEVEL_LOW>,
117                   <27 IRQ_TYPE_LEVEL_LOW>,
118                   <27 IRQ_TYPE_LEVEL_LOW>,
119                   <27 IRQ_TYPE_LEVEL_LOW>,
120                   <27 IRQ_TYPE_LEVEL_LOW>,
121                   <27 IRQ_TYPE_LEVEL_LOW>,
122                   <27 IRQ_TYPE_LEVEL_LOW>,
123                   <27 IRQ_TYPE_LEVEL_LOW>,
124                   <27 IRQ_TYPE_LEVEL_LOW>,
125                   <27 IRQ_TYPE_LEVEL_LOW>;
126    };
127