Lennert Buytenhek | 9569dae | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/plat-orion/include/plat/gpio.h |
| 3 | * |
| 4 | * Marvell Orion SoC GPIO handling. |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public |
| 7 | * License version 2. This program is licensed "as is" without any |
| 8 | * warranty of any kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | #ifndef __PLAT_GPIO_H |
| 12 | #define __PLAT_GPIO_H |
| 13 | |
Martin Michlmayr | 3e475f5 | 2009-08-17 23:34:10 -1000 | [diff] [blame^] | 14 | #include <linux/init.h> |
| 15 | |
Lennert Buytenhek | 9569dae | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 16 | /* |
| 17 | * GENERIC_GPIO primitives. |
| 18 | */ |
Erik Benada | a886565 | 2009-05-28 17:08:55 -0700 | [diff] [blame] | 19 | #define gpio_get_value __gpio_get_value |
| 20 | #define gpio_set_value __gpio_set_value |
| 21 | #define gpio_cansleep __gpio_cansleep |
Lennert Buytenhek | 9569dae | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 22 | |
| 23 | /* |
| 24 | * Orion-specific GPIO API extensions. |
| 25 | */ |
| 26 | void orion_gpio_set_unused(unsigned pin); |
Lennert Buytenhek | 9569dae | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 27 | void orion_gpio_set_blink(unsigned pin, int blink); |
| 28 | |
Erik Benada | a886565 | 2009-05-28 17:08:55 -0700 | [diff] [blame] | 29 | #define GPIO_INPUT_OK (1 << 0) |
| 30 | #define GPIO_OUTPUT_OK (1 << 1) |
Nicolas Pitre | 28d27cf | 2009-02-02 15:27:55 -0500 | [diff] [blame] | 31 | void orion_gpio_set_valid(unsigned pin, int mode); |
| 32 | |
Erik Benada | a886565 | 2009-05-28 17:08:55 -0700 | [diff] [blame] | 33 | /* Initialize gpiolib. */ |
| 34 | void __init orion_gpio_init(void); |
| 35 | |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 36 | /* |
| 37 | * GPIO interrupt handling. |
| 38 | */ |
Nicolas Pitre | fd4b9b3 | 2009-02-17 20:45:50 +0100 | [diff] [blame] | 39 | extern struct irq_chip orion_gpio_irq_chip; |
Lennert Buytenhek | 0733231 | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 40 | void orion_gpio_irq_handler(int irqoff); |
| 41 | |
Lennert Buytenhek | 9569dae | 2008-10-20 01:51:03 +0200 | [diff] [blame] | 42 | |
| 43 | #endif |