1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Realtek Otto GPIO controller
8
9maintainers:
10  - Sander Vanheule <sander@svanheule.net>
11  - Bert Vermeulen <bert@biot.com>
12
13description: |
14  Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
15  of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
16  Each bank's interrupts are cascased into one interrupt line on the parent
17  interrupt controller, if provided.
18  This binding allows defining a single bank in the devicetree. The interrupt
19  controller is not supported on the fallback compatible name, which only
20  allows for GPIO port use.
21
22properties:
23  $nodename:
24    pattern: "^gpio@[0-9a-f]+$"
25
26  compatible:
27    items:
28      - enum:
29          - realtek,rtl8380-gpio
30          - realtek,rtl8390-gpio
31          - realtek,rtl9300-gpio
32      - const: realtek,otto-gpio
33
34  reg: true
35
36  "#gpio-cells":
37    const: 2
38
39  gpio-controller: true
40
41  ngpios:
42    minimum: 1
43    maximum: 32
44
45  interrupt-controller: true
46
47  "#interrupt-cells":
48    const: 2
49
50  interrupts:
51    maxItems: 1
52
53if:
54  properties:
55    compatible:
56      contains:
57        const: realtek,rtl9300-gpio
58then:
59  properties:
60    reg:
61      items:
62        - description: GPIO and interrupt control
63        - description: interrupt CPU map
64else:
65  properties:
66    reg:
67      items:
68        - description: GPIO and interrupt control
69
70required:
71  - compatible
72  - reg
73  - "#gpio-cells"
74  - gpio-controller
75
76additionalProperties: false
77
78dependencies:
79  interrupt-controller: [ interrupts ]
80
81examples:
82  - |
83      gpio@3500 {
84        compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
85        reg = <0x3500 0x1c>;
86        gpio-controller;
87        #gpio-cells = <2>;
88        ngpios = <24>;
89        interrupt-controller;
90        #interrupt-cells = <2>;
91        interrupt-parent = <&rtlintc>;
92        interrupts = <23>;
93      };
94  - |
95      gpio@3300 {
96        compatible = "realtek,rtl9300-gpio", "realtek,otto-gpio";
97        reg = <0x3300 0x1c>, <0x3338 0x8>;
98        gpio-controller;
99        #gpio-cells = <2>;
100        ngpios = <24>;
101        interrupt-controller;
102        #interrupt-cells = <2>;
103        interrupt-parent = <&rtlintc>;
104        interrupts = <13>;
105      };
106
107...
108