Tzachi Perelstein | 01af72e | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 1 | /* |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 2 | * include/asm-arm/arch-orion5x/gpio.h |
Tzachi Perelstein | 01af72e | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 3 | * |
| 4 | * This file is licensed under the terms of the GNU General Public |
| 5 | * License version 2. This program is licensed "as is" without any |
| 6 | * warranty of any kind, whether express or implied. |
| 7 | */ |
| 8 | |
| 9 | extern int gpio_request(unsigned pin, const char *label); |
| 10 | extern void gpio_free(unsigned pin); |
| 11 | extern int gpio_direction_input(unsigned pin); |
| 12 | extern int gpio_direction_output(unsigned pin, int value); |
| 13 | extern int gpio_get_value(unsigned pin); |
| 14 | extern void gpio_set_value(unsigned pin, int value); |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 15 | extern void orion5x_gpio_set_blink(unsigned pin, int blink); |
Tzachi Perelstein | 01af72e | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 16 | extern void gpio_display(void); /* debug */ |
| 17 | |
| 18 | static inline int gpio_to_irq(int pin) |
| 19 | { |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 20 | return pin + IRQ_ORION5X_GPIO_START; |
Tzachi Perelstein | 01af72e | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | static inline int irq_to_gpio(int irq) |
| 24 | { |
Lennert Buytenhek | 9dd0b19 | 2008-03-27 14:51:41 -0400 | [diff] [blame] | 25 | return irq - IRQ_ORION5X_GPIO_START; |
Tzachi Perelstein | 01af72e | 2007-10-23 15:14:42 -0400 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | #include <asm-generic/gpio.h> /* cansleep wrappers */ |