111591c6404a57c13794cb174dd4a4258786fcdf
[openwrt/staging/dedeckeh.git] / target / linux / realtek / patches-5.10 / 001-5.13-dt-bindings-gpio-binding-for-realtek-otto-gpio.patch
1 From a362c0ce64866939c3daa17c76943cfed555b065 Mon Sep 17 00:00:00 2001
2 From: Sander Vanheule <sander@svanheule.net>
3 Date: Tue, 30 Mar 2021 19:48:42 +0200
4 Subject: dt-bindings: gpio: Binding for Realtek Otto GPIO
5
6 Add a binding description for Realtek's GPIO controller found on several
7 of their MIPS-based SoCs (codenamed Otto), such as the RTL838x and
8 RTL839x series of switch SoCs.
9
10 A fallback binding 'realtek,otto-gpio' is provided for cases where the
11 actual port ordering is not known yet, and enabling the interrupt
12 controller may result in uncaught interrupts.
13
14 Signed-off-by: Sander Vanheule <sander@svanheule.net>
15 Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
16 Reviewed-by: Rob Herring <robh@kernel.org>
17 Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
18 ---
19 .../bindings/gpio/realtek,otto-gpio.yaml | 78 ++++++++++++++++++++++
20 1 file changed, 78 insertions(+)
21 create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
22
23 diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
24 new file mode 100644
25 index 0000000000000..100f20cebd76a
26 --- /dev/null
27 +++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
28 @@ -0,0 +1,78 @@
29 +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
30 +%YAML 1.2
31 +---
32 +$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
33 +$schema: http://devicetree.org/meta-schemas/core.yaml#
34 +
35 +title: Realtek Otto GPIO controller
36 +
37 +maintainers:
38 + - Sander Vanheule <sander@svanheule.net>
39 + - Bert Vermeulen <bert@biot.com>
40 +
41 +description: |
42 + Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
43 + of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
44 + Each bank's interrupts are cascased into one interrupt line on the parent
45 + interrupt controller, if provided.
46 + This binding allows defining a single bank in the devicetree. The interrupt
47 + controller is not supported on the fallback compatible name, which only
48 + allows for GPIO port use.
49 +
50 +properties:
51 + $nodename:
52 + pattern: "^gpio@[0-9a-f]+$"
53 +
54 + compatible:
55 + items:
56 + - enum:
57 + - realtek,rtl8380-gpio
58 + - realtek,rtl8390-gpio
59 + - const: realtek,otto-gpio
60 +
61 + reg:
62 + maxItems: 1
63 +
64 + "#gpio-cells":
65 + const: 2
66 +
67 + gpio-controller: true
68 +
69 + ngpios:
70 + minimum: 1
71 + maximum: 32
72 +
73 + interrupt-controller: true
74 +
75 + "#interrupt-cells":
76 + const: 2
77 +
78 + interrupts:
79 + maxItems: 1
80 +
81 +required:
82 + - compatible
83 + - reg
84 + - "#gpio-cells"
85 + - gpio-controller
86 +
87 +additionalProperties: false
88 +
89 +dependencies:
90 + interrupt-controller: [ interrupts ]
91 +
92 +examples:
93 + - |
94 + gpio@3500 {
95 + compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
96 + reg = <0x3500 0x1c>;
97 + gpio-controller;
98 + #gpio-cells = <2>;
99 + ngpios = <24>;
100 + interrupt-controller;
101 + #interrupt-cells = <2>;
102 + interrupt-parent = <&rtlintc>;
103 + interrupts = <23>;
104 + };
105 +
106 +...
107 --
108 cgit 1.2.3-1.el7
109