[ARM] Orion: share GPIO handling code
[linux-2.6/kvm.git] / arch / arm / mach-orion5x / include / mach / gpio.h
bloba1a387b189a0776017a0ae501a7882741f56f22d
1 /*
2 * arch/arm/mach-orion5x/include/mach/gpio.h
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 */
9 #ifndef __ASM_ARCH_GPIO_H
10 #define __ASM_ARCH_GPIO_H
12 #include <mach/irqs.h>
13 #include <plat/gpio.h>
14 #include <asm-generic/gpio.h> /* cansleep wrappers */
16 #define GPIO_MAX 32
17 #define GPIO_OUT(pin) ORION5X_DEV_BUS_REG(0x100)
18 #define GPIO_IO_CONF(pin) ORION5X_DEV_BUS_REG(0x104)
19 #define GPIO_BLINK_EN(pin) ORION5X_DEV_BUS_REG(0x108)
20 #define GPIO_IN_POL(pin) ORION5X_DEV_BUS_REG(0x10c)
21 #define GPIO_DATA_IN(pin) ORION5X_DEV_BUS_REG(0x110)
23 static inline int gpio_to_irq(int pin)
25 return pin + IRQ_ORION5X_GPIO_START;
28 static inline int irq_to_gpio(int irq)
30 return irq - IRQ_ORION5X_GPIO_START;
34 #endif