Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Linus Walleij and committed by
Bartosz Golaszewski
b4c69d47 678eefc1

+12 -1
+12 -1
Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
··· 37 37 description: 38 38 A list of registers in the controller. The width of each register is 39 39 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. 41 42 items: 42 43 - description: 43 44 Register to READ the value of the GPIO lines. If GPIO line is high, ··· 74 73 - dirin 75 74 76 75 native-endian: true 76 + 77 + ngpios: 78 + minimum: 1 79 + maximum: 63 80 + description: 81 + If this property is present the number of usable GPIO lines are restricted 82 + to the first 0 .. ngpios lines. This is useful when the GPIO MMIO register 83 + has 32 bits for GPIO but only the first 12 are actually connected to 84 + real electronics, and then we set ngpios to 12. 77 85 78 86 no-output: 79 87 $ref: /schemas/types.yaml#/definitions/flag ··· 121 111 compatible = "brcm,bcm6345-gpio"; 122 112 reg-names = "dirout", "dat"; 123 113 reg = <0xfffe0406 2>, <0xfffe040a 2>; 114 + ngpios = <15>; 124 115 native-endian; 125 116 gpio-controller; 126 117 #gpio-cells = <2>;