9
0
Fork 0

arm: at91: add gpio_is_valid support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2012-10-30 22:00:15 +01:00 committed by Sascha Hauer
parent 48f7fd5bd1
commit e14a55a4c0
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@
/* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */
#define ARCH_NR_GPIOS 256
static inline int gpio_is_valid(int gpio)
{
if (gpio < 1)
return 0;
if (gpio < ARCH_NR_GPIOS)
return 1;
return 0;
}
#define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0)
#define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1)
#define AT91_PIN_PA2 (PIN_BASE + 0x00 + 2)