1951f7da9SSander Vanheule# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2951f7da9SSander Vanheule%YAML 1.2
3951f7da9SSander Vanheule---
4951f7da9SSander Vanheule$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
5951f7da9SSander Vanheule$schema: http://devicetree.org/meta-schemas/core.yaml#
6951f7da9SSander Vanheule
7951f7da9SSander Vanheuletitle: Realtek Otto GPIO controller
8951f7da9SSander Vanheule
9951f7da9SSander Vanheulemaintainers:
10951f7da9SSander Vanheule  - Sander Vanheule <sander@svanheule.net>
11951f7da9SSander Vanheule  - Bert Vermeulen <bert@biot.com>
12951f7da9SSander Vanheule
13951f7da9SSander Vanheuledescription: |
14951f7da9SSander Vanheule  Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
15951f7da9SSander Vanheule  of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
16951f7da9SSander Vanheule  Each bank's interrupts are cascased into one interrupt line on the parent
17951f7da9SSander Vanheule  interrupt controller, if provided.
18951f7da9SSander Vanheule  This binding allows defining a single bank in the devicetree. The interrupt
19951f7da9SSander Vanheule  controller is not supported on the fallback compatible name, which only
20951f7da9SSander Vanheule  allows for GPIO port use.
21951f7da9SSander Vanheule
22951f7da9SSander Vanheuleproperties:
23951f7da9SSander Vanheule  $nodename:
24951f7da9SSander Vanheule    pattern: "^gpio@[0-9a-f]+$"
25951f7da9SSander Vanheule
26951f7da9SSander Vanheule  compatible:
27951f7da9SSander Vanheule    items:
28951f7da9SSander Vanheule      - enum:
29951f7da9SSander Vanheule          - realtek,rtl8380-gpio
30951f7da9SSander Vanheule          - realtek,rtl8390-gpio
3106a6a774SSander Vanheule          - realtek,rtl9300-gpio
32*d0b55b69SSander Vanheule          - realtek,rtl9310-gpio
33951f7da9SSander Vanheule      - const: realtek,otto-gpio
34951f7da9SSander Vanheule
3506a6a774SSander Vanheule  reg: true
36951f7da9SSander Vanheule
37951f7da9SSander Vanheule  "#gpio-cells":
38951f7da9SSander Vanheule    const: 2
39951f7da9SSander Vanheule
40951f7da9SSander Vanheule  gpio-controller: true
41951f7da9SSander Vanheule
42951f7da9SSander Vanheule  ngpios:
43951f7da9SSander Vanheule    minimum: 1
44951f7da9SSander Vanheule    maximum: 32
45951f7da9SSander Vanheule
46951f7da9SSander Vanheule  interrupt-controller: true
47951f7da9SSander Vanheule
48951f7da9SSander Vanheule  "#interrupt-cells":
49951f7da9SSander Vanheule    const: 2
50951f7da9SSander Vanheule
51951f7da9SSander Vanheule  interrupts:
52951f7da9SSander Vanheule    maxItems: 1
53951f7da9SSander Vanheule
5406a6a774SSander Vanheuleif:
5506a6a774SSander Vanheule  properties:
5606a6a774SSander Vanheule    compatible:
5706a6a774SSander Vanheule      contains:
5806a6a774SSander Vanheule        const: realtek,rtl9300-gpio
5906a6a774SSander Vanheulethen:
6006a6a774SSander Vanheule  properties:
6106a6a774SSander Vanheule    reg:
6206a6a774SSander Vanheule      items:
6306a6a774SSander Vanheule        - description: GPIO and interrupt control
6406a6a774SSander Vanheule        - description: interrupt CPU map
6506a6a774SSander Vanheuleelse:
6606a6a774SSander Vanheule  properties:
6706a6a774SSander Vanheule    reg:
6806a6a774SSander Vanheule      items:
6906a6a774SSander Vanheule        - description: GPIO and interrupt control
7006a6a774SSander Vanheule
71951f7da9SSander Vanheulerequired:
72951f7da9SSander Vanheule  - compatible
73951f7da9SSander Vanheule  - reg
74951f7da9SSander Vanheule  - "#gpio-cells"
75951f7da9SSander Vanheule  - gpio-controller
76951f7da9SSander Vanheule
77951f7da9SSander VanheuleadditionalProperties: false
78951f7da9SSander Vanheule
79951f7da9SSander Vanheuledependencies:
80951f7da9SSander Vanheule  interrupt-controller: [ interrupts ]
81951f7da9SSander Vanheule
82951f7da9SSander Vanheuleexamples:
83951f7da9SSander Vanheule  - |
84951f7da9SSander Vanheule      gpio@3500 {
85951f7da9SSander Vanheule        compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
86951f7da9SSander Vanheule        reg = <0x3500 0x1c>;
87951f7da9SSander Vanheule        gpio-controller;
88951f7da9SSander Vanheule        #gpio-cells = <2>;
89951f7da9SSander Vanheule        ngpios = <24>;
90951f7da9SSander Vanheule        interrupt-controller;
91951f7da9SSander Vanheule        #interrupt-cells = <2>;
92951f7da9SSander Vanheule        interrupt-parent = <&rtlintc>;
93951f7da9SSander Vanheule        interrupts = <23>;
94951f7da9SSander Vanheule      };
9506a6a774SSander Vanheule  - |
9606a6a774SSander Vanheule      gpio@3300 {
9706a6a774SSander Vanheule        compatible = "realtek,rtl9300-gpio", "realtek,otto-gpio";
9806a6a774SSander Vanheule        reg = <0x3300 0x1c>, <0x3338 0x8>;
9906a6a774SSander Vanheule        gpio-controller;
10006a6a774SSander Vanheule        #gpio-cells = <2>;
10106a6a774SSander Vanheule        ngpios = <24>;
10206a6a774SSander Vanheule        interrupt-controller;
10306a6a774SSander Vanheule        #interrupt-cells = <2>;
10406a6a774SSander Vanheule        interrupt-parent = <&rtlintc>;
10506a6a774SSander Vanheule        interrupts = <13>;
10606a6a774SSander Vanheule      };
107951f7da9SSander Vanheule
108951f7da9SSander Vanheule...
109