Skip to content

Commit

Permalink
gpio: allow setting ARCH_NR_GPIOS from Kconfig
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Linus Walleij committed Feb 18, 2016
1 parent d7f7764 commit aa6aedb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/asm-generic/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
*/

#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
Expand Down

0 comments on commit aa6aedb

Please sign in to comment.