1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/renesas,rcar-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Renesas R-Car General-Purpose Input/Output Ports (GPIO)
8
9maintainers:
10  - Geert Uytterhoeven <geert+renesas@glider.be>
11
12properties:
13  compatible:
14    oneOf:
15      - items:
16          - enum:
17              - renesas,gpio-r8a7778      # R-Car M1
18              - renesas,gpio-r8a7779      # R-Car H1
19          - const: renesas,rcar-gen1-gpio # R-Car Gen1
20
21      - items:
22          - enum:
23              - renesas,gpio-r8a7742      # RZ/G1H
24              - renesas,gpio-r8a7743      # RZ/G1M
25              - renesas,gpio-r8a7744      # RZ/G1N
26              - renesas,gpio-r8a7745      # RZ/G1E
27              - renesas,gpio-r8a77470     # RZ/G1C
28              - renesas,gpio-r8a7790      # R-Car H2
29              - renesas,gpio-r8a7791      # R-Car M2-W
30              - renesas,gpio-r8a7792      # R-Car V2H
31              - renesas,gpio-r8a7793      # R-Car M2-N
32              - renesas,gpio-r8a7794      # R-Car E2
33          - const: renesas,rcar-gen2-gpio # R-Car Gen2 or RZ/G1
34
35      - items:
36          - enum:
37              - renesas,gpio-r8a774a1     # RZ/G2M
38              - renesas,gpio-r8a774b1     # RZ/G2N
39              - renesas,gpio-r8a774c0     # RZ/G2E
40              - renesas,gpio-r8a774e1     # RZ/G2H
41              - renesas,gpio-r8a7795      # R-Car H3
42              - renesas,gpio-r8a7796      # R-Car M3-W
43              - renesas,gpio-r8a77961     # R-Car M3-W+
44              - renesas,gpio-r8a77965     # R-Car M3-N
45              - renesas,gpio-r8a77970     # R-Car V3M
46              - renesas,gpio-r8a77980     # R-Car V3H
47              - renesas,gpio-r8a77990     # R-Car E3
48              - renesas,gpio-r8a77995     # R-Car D3
49          - const: renesas,rcar-gen3-gpio # R-Car Gen3 or RZ/G2
50
51      - items:
52          - enum:
53              - renesas,gpio-r8a779a0     # R-Car V3U
54              - renesas,gpio-r8a779f0     # R-Car S4-8
55              - renesas,gpio-r8a779g0     # R-Car V4H
56          - const: renesas,rcar-gen4-gpio # R-Car Gen4
57
58  reg:
59    maxItems: 1
60
61  interrupts:
62    maxItems: 1
63
64  clocks:
65    maxItems: 1
66
67  power-domains:
68    maxItems: 1
69
70  resets:
71    maxItems: 1
72
73  gpio-controller: true
74
75  '#gpio-cells':
76    const: 2
77
78  interrupt-controller: true
79
80  '#interrupt-cells':
81    const: 2
82
83  gpio-ranges:
84    maxItems: 1
85
86  gpio-reserved-ranges:
87    minItems: 1
88    maxItems: 8
89
90patternProperties:
91  "^.*$":
92    if:
93      type: object
94    then:
95      properties:
96        gpio-hog: true
97        gpios: true
98        input: true
99        output-high: true
100        output-low: true
101        line-name: true
102
103      required:
104        - gpio-hog
105        - gpios
106
107      additionalProperties: false
108
109required:
110  - compatible
111  - reg
112  - interrupts
113  - gpio-controller
114  - '#gpio-cells'
115  - gpio-ranges
116  - interrupt-controller
117  - '#interrupt-cells'
118
119if:
120  not:
121    properties:
122      compatible:
123        contains:
124          enum:
125            - renesas,rcar-gen1-gpio
126then:
127  required:
128    - clocks
129    - power-domains
130    - resets
131
132additionalProperties: false
133
134examples:
135  - |
136    #include <dt-bindings/clock/r8a77470-cpg-mssr.h>
137    #include <dt-bindings/interrupt-controller/arm-gic.h>
138    #include <dt-bindings/power/r8a77470-sysc.h>
139    gpio3: gpio@e6053000 {
140            compatible = "renesas,gpio-r8a77470", "renesas,rcar-gen2-gpio";
141            reg = <0xe6053000 0x50>;
142            interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
143            clocks = <&cpg CPG_MOD 909>;
144            power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
145            resets = <&cpg 909>;
146            gpio-controller;
147            #gpio-cells = <2>;
148            gpio-ranges = <&pfc 0 96 30>;
149            gpio-reserved-ranges = <17 10>;
150            interrupt-controller;
151            #interrupt-cells = <2>;
152     };
153