gpio: nomadik: handle variadic GPIO count
authorThéo Lebrun <theo.lebrun@bootlin.com>
Wed, 28 Feb 2024 11:28:21 +0000 (12:28 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 29 Feb 2024 09:36:20 +0000 (10:36 +0100)
commit50bc2a4953cceb70f90d37fd513dd1231367aa4d
tree4e8b47bd64f90245a3ec0b5ed199275cb7a410f9
parent8d74c3dc8f99d9867254004ed49508c13295cacd
gpio: nomadik: handle variadic GPIO count

Read the "ngpios" property to determine the number of GPIOs for a bank.
If not available, fallback to NMK_GPIO_PER_CHIP ie 32 ie the current
behavior.

The IP block always supports 32 GPIOs, but platforms can expose a lesser
amount. The Mobileye EyeQ5 is in this case; one bank is 29 GPIOs and
the other is 23.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20240228-mbly-gpio-v2-23-3ba757474006@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-nomadik.c