diff options
| author | Robert Richter <robert.richter@amd.com> | 2010-10-01 10:54:17 +0400 |
|---|---|---|
| committer | Robert Richter <robert.richter@amd.com> | 2010-10-01 10:54:17 +0400 |
| commit | ef70fcc0cd5d98f5e2df82c9e598b47f351d4f66 (patch) | |
| tree | b801ba4d7ebb1155df68d530df49444ffa6252cc /include/asm-generic/gpio.h | |
| parent | 4cbe75be5c6ae86bdc7daec864eeb2dfd66f48bb (diff) | |
| parent | 98d943b02f6f1b57787ff1aa6f34d019a407e3ee (diff) | |
| download | linux-ef70fcc0cd5d98f5e2df82c9e598b47f351d4f66.tar.xz | |
Merge branch 'oprofile/urgent' into oprofile/core
Conflicts:
arch/arm/oprofile/common.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'include/asm-generic/gpio.h')
| -rw-r--r-- | include/asm-generic/gpio.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index c7376bf80b06..8ca18e26d7e3 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -16,15 +16,27 @@ * While the GPIO programming interface defines valid GPIO numbers * to be in the range 0..MAX_INT, this library restricts them to the * smaller range 0..ARCH_NR_GPIOS-1. + * + * ARCH_NR_GPIOS is somewhat arbitrary; it usually reflects the sum of + * builtin/SoC GPIOs plus a number of GPIOs on expanders; the latter is + * actually an estimate of a board-specific value. */ #ifndef ARCH_NR_GPIOS #define ARCH_NR_GPIOS 256 #endif +/* + * "valid" GPIO numbers are nonnegative and may be passed to + * setup routines like gpio_request(). only some valid numbers + * can successfully be requested and used. + * + * Invalid GPIO numbers are useful for indicating no-such-GPIO in + * platform data and other tables. + */ + static inline int gpio_is_valid(int number) { - /* only some non-negative numbers are valid */ return ((unsigned)number) < ARCH_NR_GPIOS; } |
