Skip to content

Commit b4c69d4

Browse files
Linus WalleijBartosz Golaszewski
authored andcommitted
dt-bindings: gpio-mmio: Add ngpios property
This adds the ngpios property to MMIO GPIO. We restrict the property to 1..63 since there is no point in 0 GPIO lines and we support up to 64bits wide registers for now. Acked-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20241017-gpio-ngpios-v2-1-cecfdb38d40e@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 678eefc commit b4c69d4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Documentation/devicetree/bindings/gpio/gpio-mmio.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ properties:
3737
description:
3838
A list of registers in the controller. The width of each register is
3939
determined by its size. All registers must have the same width. The number
40-
of GPIOs is set by the width, with bit 0 corresponding to GPIO 0.
40+
of GPIOs is set by the width, with bit 0 corresponding to GPIO 0, unless
41+
the ngpios property further restricts the number of used lines.
4142
items:
4243
- description:
4344
Register to READ the value of the GPIO lines. If GPIO line is high,
@@ -74,6 +75,15 @@ properties:
7475

7576
native-endian: true
7677

78+
ngpios:
79+
minimum: 1
80+
maximum: 63
81+
description:
82+
If this property is present the number of usable GPIO lines are restricted
83+
to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register
84+
has 32 bits for GPIO but only the first 12 are actually connected to
85+
real electronics, and then we set ngpios to 12.
86+
7787
no-output:
7888
$ref: /schemas/types.yaml#/definitions/flag
7989
description:
@@ -111,6 +121,7 @@ examples:
111121
compatible = "brcm,bcm6345-gpio";
112122
reg-names = "dirout", "dat";
113123
reg = <0xfffe0406 2>, <0xfffe040a 2>;
124+
ngpios = <15>;
114125
native-endian;
115126
gpio-controller;
116127
#gpio-cells = <2>;

0 commit comments

Comments
 (0)