David Brownell | 4c20386 | 2007-02-12 00:53:11 -0800 | [diff] [blame] | 1 | #ifndef _ARCH_ARM_GPIO_H |
| 2 | #define _ARCH_ARM_GPIO_H |
| 3 | |
Peter De Schrijver (NVIDIA) | 44986ab | 2011-12-21 10:48:45 +0100 | [diff] [blame] | 4 | #if CONFIG_ARCH_NR_GPIO > 0 |
Stephen Warren | ca95023 | 2012-01-05 21:36:27 +0100 | [diff] [blame] | 5 | #define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO |
Peter De Schrijver (NVIDIA) | 44986ab | 2011-12-21 10:48:45 +0100 | [diff] [blame] | 6 | #endif |
| 7 | |
David Brownell | 4c20386 | 2007-02-12 00:53:11 -0800 | [diff] [blame] | 8 | /* not all ARM platforms necessarily support this API ... */ |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 9 | #include <mach/gpio.h> |
David Brownell | 4c20386 | 2007-02-12 00:53:11 -0800 | [diff] [blame] | 10 | |
Russell King | 8f3c453 | 2011-08-08 13:58:28 +0100 | [diff] [blame] | 11 | #ifndef __ARM_GPIOLIB_COMPLEX |
Russell King | 22fe678 | 2011-07-26 11:04:51 +0100 | [diff] [blame] | 12 | /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ |
| 13 | #include <asm-generic/gpio.h> |
| 14 | |
| 15 | /* The trivial gpiolib dispatchers */ |
| 16 | #define gpio_get_value __gpio_get_value |
| 17 | #define gpio_set_value __gpio_set_value |
| 18 | #define gpio_cansleep __gpio_cansleep |
| 19 | #endif |
| 20 | |
Russell King | 01e7dc8 | 2011-07-26 11:29:42 +0100 | [diff] [blame] | 21 | /* |
| 22 | * Provide a default gpio_to_irq() which should satisfy every case. |
| 23 | * However, some platforms want to do this differently, so allow them |
| 24 | * to override it. |
| 25 | */ |
| 26 | #ifndef gpio_to_irq |
| 27 | #define gpio_to_irq __gpio_to_irq |
| 28 | #endif |
| 29 | |
David Brownell | 4c20386 | 2007-02-12 00:53:11 -0800 | [diff] [blame] | 30 | #endif /* _ARCH_ARM_GPIO_H */ |