[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H5ZQQpHS_b9UL8UNgX9MH8-i4DV8bid00vEDzg76rgebw@mail.gmail.com>
Date: Sat, 16 Aug 2025 22:18:57 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Yao Zi <ziyao@...root.org>
Cc: Yinbo Zhu <zhuyinbo@...ngson.cn>, Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
WANG Xuerui <kernel@...0n.name>, Philipp Zabel <p.zabel@...gutronix.de>, linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev, Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>
Subject: Re: [PATCH 1/3] dt-bindings: gpio: loongson: Document GPIO controller
of 2K0300 SoC
On Sat, Aug 16, 2025 at 11:51 AM Yao Zi <ziyao@...root.org> wrote:
>
> Loongson 2K0300 ships a GPIO controller whose input/output control logic
> is similar to previous generation of SoCs. Additionally, it acts as an
> interrupt-controller supporting both level and edge interrupts and has a
> distinct reset signal.
>
> Describe its compatible in devicetree. We enlarge the maximum value of
> ngpios to 128, since the controller technically supports at most 128
> pins, although only 106 are routed out of the package. Properties for
> interrupt-controllers and resets are introduced and limited as 2K0300
> only.
>
> Signed-off-by: Yao Zi <ziyao@...root.org>
> ---
> .../bindings/gpio/loongson,ls-gpio.yaml | 28 ++++++++++++++++++-
> 1 file changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml
> index b68159600e2b..69852444df23 100644
> --- a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml
> @@ -14,6 +14,7 @@ properties:
> oneOf:
> - enum:
> - loongson,ls2k-gpio
> + - loongson,ls2k0300-gpio
> - loongson,ls2k0500-gpio0
> - loongson,ls2k0500-gpio1
> - loongson,ls2k2000-gpio0
> @@ -36,7 +37,7 @@ properties:
>
> ngpios:
> minimum: 1
> - maximum: 64
> + maximum: 128
>
> "#gpio-cells":
> const: 2
> @@ -49,6 +50,14 @@ properties:
> minItems: 1
> maxItems: 64
>
> + "#interrupt-cells":
> + const: 2
> +
> + interrupt-controller: true
ls2k300 supports interrupt-controller while others don't?
Huacai
> +
> + resets:
> + maxItems: 1
> +
> required:
> - compatible
> - reg
> @@ -58,6 +67,23 @@ required:
> - gpio-ranges
> - interrupts
>
> +allOf:
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: loongson,ls2k0300-gpio
> + then:
> + required:
> + - "#interrupt-cells"
> + - interrupt-controller
> + - resets
> + else:
> + properties:
> + "#interrupts-cells": false
> + interrupt-controller: false
> + resets: false
> +
> additionalProperties: false
>
> examples:
> --
> 2.50.1
>
Powered by blists - more mailing lists