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