Skip to content

Commit 084d01a

Browse files
ziyao233Bartosz Golaszewski
authored andcommitted
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>
1 parent d3e7efa commit 084d01a

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ properties:
1414
oneOf:
1515
- enum:
1616
- loongson,ls2k-gpio
17+
- loongson,ls2k0300-gpio
1718
- loongson,ls2k0500-gpio0
1819
- loongson,ls2k0500-gpio1
1920
- loongson,ls2k2000-gpio0
@@ -36,7 +37,7 @@ properties:
3637

3738
ngpios:
3839
minimum: 1
39-
maximum: 64
40+
maximum: 128
4041

4142
"#gpio-cells":
4243
const: 2
@@ -49,6 +50,14 @@ properties:
4950
minItems: 1
5051
maxItems: 64
5152

53+
"#interrupt-cells":
54+
const: 2
55+
56+
interrupt-controller: true
57+
58+
resets:
59+
maxItems: 1
60+
5261
required:
5362
- compatible
5463
- reg
@@ -58,6 +67,23 @@ required:
5867
- gpio-ranges
5968
- interrupts
6069

70+
allOf:
71+
- if:
72+
properties:
73+
compatible:
74+
contains:
75+
const: loongson,ls2k0300-gpio
76+
then:
77+
required:
78+
- "#interrupt-cells"
79+
- interrupt-controller
80+
- resets
81+
else:
82+
properties:
83+
"#interrupts-cells": false
84+
interrupt-controller: false
85+
resets: false
86+
6187
additionalProperties: false
6288

6389
examples:

0 commit comments

Comments
 (0)