Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp45172pxf; Wed, 24 Mar 2021 20:28:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAAqxso4IyON3uvn39EkM4VAfoUrCOmX1St53zK37hTJ4X36kUJDTrVXm1YYBplUgO2aFY X-Received: by 2002:a17:907:162b:: with SMTP id hb43mr7147969ejc.41.1616642904121; Wed, 24 Mar 2021 20:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616642904; cv=none; d=google.com; s=arc-20160816; b=DnA64rPqk+XdgEgR5jmptqPlNSOG0ZHQMH2D0gYztDDGhF91UXgZHvgQGQpzHI5BiU r4j4knMTsVQX56ZxSNA+pUNeNkcLI+txXz/snBXS74iAnrSwb8PAoTZ2snQ/8k7C9sML eOQS3vzbD6SuHoFVm03nrbVtfMOkvo5xKU2T0o+AGBzrzvnOKI1zbO8sZcpr0yaQRL1D XH3t4bmOyt/NMbBc2tb/EDEel6mcw6UWtu6pJBT4Szqi72z2nSN3iL7c1ccaRyGFErcC RLGuVDZdZ/8FvKdGlDv+YzwhS3VS32CiTSP3wjqx3p17ThKYBXzWVM/VcEeS4LiVs4lW M/0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GpKdNEJ4r004QUpfZvXpoZXcjNtQLPDfrL1bOUk0JfM=; b=HFKXORNso3LUAgSv3UajejRAbxhN4iAghSEpv8NscS3J/vdF1E2sXyXpkBTs0B+n11 +8C18pO000gGFo7P7jpBcWyE+ZLnjoLbA0BfVD4v8nVv2KqTrZPEkkkdtDxH5adUXkeJ KcFOp8RV9sHpdJ6Yy11S54ItzFHRQTDyLn4WzNAQXaajEOkNkrohfnUIGjV7KBVvMok1 ZQujOOu1GqzlA6ItToewpiTfVLp9DEr+UI5wzLSJR+P6JF4vsGcUSxlbRjnACIXd86Am r3Tuw5VLphcsEXZIO1B+ik/aYLEJ6+VbMTJ9vEsENLAdv7bods/l2/6QIBf86qOdrDBI 6YBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=X9o7FlNo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id he34si3352114ejc.317.2021.03.24.20.28.02; Wed, 24 Mar 2021 20:28:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=X9o7FlNo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238302AbhCXVXv (ORCPT + 99 others); Wed, 24 Mar 2021 17:23:51 -0400 Received: from polaris.svanheule.net ([84.16.241.116]:40014 "EHLO polaris.svanheule.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238280AbhCXVXi (ORCPT ); Wed, 24 Mar 2021 17:23:38 -0400 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eaff:9f01:9a93:b6b:1adc:3da7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id AE1561E4FF7; Wed, 24 Mar 2021 22:23:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1616621016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GpKdNEJ4r004QUpfZvXpoZXcjNtQLPDfrL1bOUk0JfM=; b=X9o7FlNo2Glj1KDQ7u0mPoDZORhvUdB+gQb5YoBcOwteyRbGFJZ2CsUtZyX0cBAfvz5S+3 VI4JBDwxNhnI2kybcOFSUrRN7cVI2Jz7h7o3QTmh5Jyv1R58IyMX0/EBy4yBLcWHOo7BDd d8hkmO+B258fHECjeUAYMFWp8SaDYHj3xm62xKozfYXOVOo3sVNS/3tJ2DCaY1h4u5ExRI ws08lLUEgNURXPSht/Yj7hrDVfFodYuiCpAHdq6tbIaHQGpPiAGazoqfzwzSMyqdVW4rOu k3i+giSy7UrRy8dpHcFGrAfdfB56sEnr/l6vpDvpVUQJeaJQ0M7TKtaEg889ZA== From: Sander Vanheule 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 Subject: [PATCH v3 1/2] dt-bindings: gpio: Binding for Realtek Otto GPIO Date: Wed, 24 Mar 2021 22:22:40 +0100 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Linus Walleij --- .../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 + - Bert Vermeulen + +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