linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sander Vanheule <sander@svanheule.net>
To: devicetree@vger.kernel.org, linux-gpio@vger.kernel.org
Cc: bert@biot.com, bgolaszewski@baylibre.com,
	linus.walleij@linaro.org, linux-kernel@vger.kernel.org,
	maz@kernel.org, robh+dt@kernel.org, tglx@linutronix.de,
	Sander Vanheule <sander@svanheule.net>
Subject: [PATCH v3 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO
Date: Wed, 24 Mar 2021 22:22:40 +0100	[thread overview]
Message-ID: <cda4ad68a031b60d407629e9232df495d3e260c2.1616620884.git.sander@svanheule.net> (raw)
In-Reply-To: <cover.1616620884.git.sander@svanheule.net>

Add a binding description for Realtek's GPIO controller found on several
of their MIPS-based SoCs (codenamed Otto), such as the RTL838x and
RTL839x series of switch SoCs.

A fallback binding 'realtek,otto-gpio' is provided for cases where the
actual port ordering is not known yet, and enabling the interrupt
controller may result in uncaught interrupts.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../bindings/gpio/realtek,otto-gpio.yaml      | 78 +++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml

diff --git a/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
new file mode 100644
index 000000000000..100f20cebd76
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/realtek,otto-gpio.yaml
@@ -0,0 +1,78 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/realtek,otto-gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek Otto GPIO controller
+
+maintainers:
+  - Sander Vanheule <sander@svanheule.net>
+  - Bert Vermeulen <bert@biot.com>
+
+description: |
+  Realtek's GPIO controller on their MIPS switch SoCs (Otto platform) consists
+  of two banks of 32 GPIOs. These GPIOs can generate edge-triggered interrupts.
+  Each bank's interrupts are cascased into one interrupt line on the parent
+  interrupt controller, if provided.
+  This binding allows defining a single bank in the devicetree. The interrupt
+  controller is not supported on the fallback compatible name, which only
+  allows for GPIO port use.
+
+properties:
+  $nodename:
+    pattern: "^gpio@[0-9a-f]+$"
+
+  compatible:
+    items:
+      - enum:
+          - realtek,rtl8380-gpio
+          - realtek,rtl8390-gpio
+      - const: realtek,otto-gpio
+
+  reg:
+    maxItems: 1
+
+  "#gpio-cells":
+    const: 2
+
+  gpio-controller: true
+
+  ngpios:
+    minimum: 1
+    maximum: 32
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - "#gpio-cells"
+  - gpio-controller
+
+additionalProperties: false
+
+dependencies:
+  interrupt-controller: [ interrupts ]
+
+examples:
+  - |
+      gpio@3500 {
+        compatible = "realtek,rtl8380-gpio", "realtek,otto-gpio";
+        reg = <0x3500 0x1c>;
+        gpio-controller;
+        #gpio-cells = <2>;
+        ngpios = <24>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&rtlintc>;
+        interrupts = <23>;
+      };
+
+...
-- 
2.30.2


  reply	other threads:[~2021-03-24 21:24 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  8:23 [PATCH 0/2] Add Realtek Otto GPIO support Sander Vanheule
2021-03-15  8:23 ` [PATCH 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Sander Vanheule
2021-03-15 15:01   ` Linus Walleij
2021-03-15  8:23 ` [PATCH 2/2] gpio: Add Realtek Otto GPIO support Sander Vanheule
2021-03-15 15:10   ` Linus Walleij
2021-03-15 19:09     ` Sander Vanheule
2021-03-15 19:08 ` [PATCH v2 0/2] " Sander Vanheule
2021-03-15 19:08   ` [PATCH v2 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Sander Vanheule
2021-03-24 18:29     ` Rob Herring
2021-03-15 19:08   ` [PATCH v2 2/2] gpio: Add Realtek Otto GPIO support Sander Vanheule
2021-03-17 13:08     ` Andy Shevchenko
2021-03-19 15:51       ` Sander Vanheule
2021-03-19 17:57         ` Andy Shevchenko
2021-03-19 21:20           ` Sander Vanheule
2021-03-19 21:24             ` Andy Shevchenko
2021-03-19 21:48               ` Sander Vanheule
2021-03-22 13:16                 ` Andy Shevchenko
2021-03-24 21:22 ` [PATCH v3 0/2] " Sander Vanheule
2021-03-24 21:22   ` Sander Vanheule [this message]
2021-03-24 21:22   ` [PATCH v3 2/2] gpio: " Sander Vanheule
2021-03-24 21:29     ` Sander Vanheule
2021-03-26 12:03 ` [PATCH v4 0/2] " Sander Vanheule
2021-03-26 12:03   ` [PATCH v4 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Sander Vanheule
2021-03-27 18:16     ` Rob Herring
2021-03-26 12:03   ` [PATCH v4 2/2] gpio: Add Realtek Otto GPIO support Sander Vanheule
2021-03-26 18:19     ` Andy Shevchenko
2021-03-26 21:11       ` Sander Vanheule
2021-03-29 10:26         ` Andy Shevchenko
2021-03-29 17:28           ` Sander Vanheule
2021-03-30 10:14             ` Andy Shevchenko
2021-03-30 15:26 ` [PATCH v5 0/2] " Sander Vanheule
2021-03-30 15:26   ` [PATCH v5 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Sander Vanheule
2021-03-30 15:26   ` [PATCH v5 2/2] gpio: Add Realtek Otto GPIO support Sander Vanheule
2021-03-30 16:43     ` Andy Shevchenko
2021-03-30 17:48 ` [PATCH v6 0/2] " Sander Vanheule
2021-03-30 17:48   ` [PATCH v6 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Sander Vanheule
2021-03-30 17:48   ` [PATCH v6 2/2] gpio: Add Realtek Otto GPIO support Sander Vanheule
2021-03-31  7:49   ` [PATCH v6 0/2] " Bartosz Golaszewski
2021-03-31  8:11     ` Sander Vanheule

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cda4ad68a031b60d407629e9232df495d3e260c2.1616620884.git.sander@svanheule.net \
    --to=sander@svanheule.net \
    --cc=bert@biot.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).