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-r8a7795      # R-Car H3
41              - renesas,gpio-r8a7796      # R-Car M3-W
42              - renesas,gpio-r8a77961     # R-Car M3-W+
43              - renesas,gpio-r8a77965     # R-Car M3-N
44              - renesas,gpio-r8a77970     # R-Car V3M
45              - renesas,gpio-r8a77980     # R-Car V3H
46              - renesas,gpio-r8a77990     # R-Car E3
47              - renesas,gpio-r8a77995     # R-Car D3
48          - const: renesas,rcar-gen3-gpio # R-Car Gen3 or RZ/G2
49
50  reg:
51    maxItems: 1
52
53  interrupts:
54    maxItems: 1
55
56  clocks:
57    maxItems: 1
58
59  power-domains:
60    maxItems: 1
61
62  resets:
63    maxItems: 1
64
65  gpio-controller: true
66
67  '#gpio-cells':
68    const: 2
69
70  interrupt-controller: true
71
72  '#interrupt-cells':
73    const: 2
74
75  gpio-ranges:
76    maxItems: 1
77
78  gpio-reserved-ranges:
79    minItems: 1
80    maxItems: 8
81
82patternProperties:
83  "^.*$":
84    if:
85      type: object
86    then:
87      properties:
88        gpio-hog: true
89        gpios: true
90        input: true
91        output-high: true
92        output-low: true
93        line-name: true
94
95      required:
96        - gpio-hog
97        - gpios
98
99      additionalProperties: false
100
101required:
102  - compatible
103  - reg
104  - interrupts
105  - gpio-controller
106  - '#gpio-cells'
107  - gpio-ranges
108  - interrupt-controller
109  - '#interrupt-cells'
110
111if:
112  not:
113    properties:
114      compatible:
115        contains:
116          enum:
117            - renesas,rcar-gen1-gpio
118then:
119  required:
120    - clocks
121    - power-domains
122    - resets
123
124additionalProperties: false
125
126examples:
127  - |
128    #include <dt-bindings/clock/r8a77470-cpg-mssr.h>
129    #include <dt-bindings/interrupt-controller/arm-gic.h>
130    #include <dt-bindings/power/r8a77470-sysc.h>
131    gpio3: gpio@e6053000 {
132            compatible = "renesas,gpio-r8a77470", "renesas,rcar-gen2-gpio";
133            reg = <0xe6053000 0x50>;
134            interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
135            clocks = <&cpg CPG_MOD 909>;
136            power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
137            resets = <&cpg 909>;
138            gpio-controller;
139            #gpio-cells = <2>;
140            gpio-ranges = <&pfc 0 96 30>;
141            gpio-reserved-ranges = <17 10>;
142            interrupt-controller;
143            #interrupt-cells = <2>;
144     };
145