gpio: allow setting ARCH_NR_GPIOS from Kconfig
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 Feb 2016 15:40:38 +0000 (16:40 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 18 Feb 2016 23:22:54 +0000 (00:22 +0100)
The ARM version of asm/gpio.h basically just contains the same definitions
as the gpiolib version, with the exception of ARCH_NR_GPIOS.

This adds the option for overriding the constant through Kconfig to
the architecture-independent header, so we can remove the ARM specific
file later.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
include/asm-generic/gpio.h

index 40ec1433f05de25d15cedaeaf2388b2cc8d0298c..8ca627dcea11096b992135679571fa44bba0ee32 100644 (file)
  */
 
 #ifndef ARCH_NR_GPIOS
+#if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0
+#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
+#else
 #define ARCH_NR_GPIOS          512
 #endif
+#endif
 
 /*
  * "valid" GPIO numbers are nonnegative and may be passed to