Skip to content

Commit aa6aedb

Browse files
arndbLinus Walleij
authored andcommitted
gpio: allow setting ARCH_NR_GPIOS from Kconfig
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>
1 parent d7f7764 commit aa6aedb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

include/asm-generic/gpio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@
2626
*/
2727

2828
#ifndef ARCH_NR_GPIOS
29+
#if defined(CONFIG_ARCH_NR_GPIO) && CONFIG_ARCH_NR_GPIO > 0
30+
#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
31+
#else
2932
#define ARCH_NR_GPIOS 512
3033
#endif
34+
#endif
3135

3236
/*
3337
* "valid" GPIO numbers are nonnegative and may be passed to

0 commit comments

Comments
 (0)