dt-bindings: gpio: loongson: Document GPIO controller of LS2K0300 SoC

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 LS2K0300
only.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250904013438.2405-2-ziyao@disroot.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
Yao Zi
2026-02-04 16:39:21 +08:00
committed by maoxiaochuan
parent 3868c2b58e
commit 1e9ca25a84
@@ -14,6 +14,7 @@ properties:
oneOf:
- enum:
- loongson,ls2k-gpio
- loongson,ls2k0300-gpio
- loongson,ls2k0500-gpio0
- loongson,ls2k0500-gpio1
- loongson,ls2k2000-gpio0
@@ -33,7 +34,7 @@ properties:
ngpios:
minimum: 1
maximum: 64
maximum: 128
"#gpio-cells":
const: 2
@@ -46,6 +47,14 @@ properties:
minItems: 1
maxItems: 64
"#interrupt-cells":
const: 2
interrupt-controller: true
resets:
maxItems: 1
required:
- compatible
- reg
@@ -55,6 +64,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: