diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 22:44:18 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-31 22:44:18 +0100 |
commit | 43872fa788060eef91ae437957e0a5e39f1c56fd (patch) | |
tree | dba464da61167d84b4f7470edebd5a769a78f9ee /arch/arm/mach-mmp/include/mach/gpio-pxa.h | |
parent | 91fed558d0f33c74477569f50ed883fe6d430f1f (diff) | |
parent | f55be1bf52aad524dc1bf556ae26c90262c87825 (diff) | |
download | blackbird-op-linux-43872fa788060eef91ae437957e0a5e39f1c56fd.tar.gz blackbird-op-linux-43872fa788060eef91ae437957e0a5e39f1c56fd.zip |
Merge branch 'depends/rmk/gpio' into next/fixes
This sorts out merge conflicts with the arm/gpio branch that
already got merged into mainline Linux.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-mmp/include/mach/gpio-pxa.h')
-rw-r--r-- | arch/arm/mach-mmp/include/mach/gpio-pxa.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/include/mach/gpio-pxa.h b/arch/arm/mach-mmp/include/mach/gpio-pxa.h new file mode 100644 index 000000000000..d14eeaf16322 --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/gpio-pxa.h @@ -0,0 +1,30 @@ +#ifndef __ASM_MACH_GPIO_PXA_H +#define __ASM_MACH_GPIO_PXA_H + +#include <mach/addr-map.h> +#include <mach/irqs.h> + +#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) + +#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) +#define GPIO_REG(x) (GPIO_REGS_VIRT + (x)) + +#define NR_BUILTIN_GPIO IRQ_GPIO_NUM + +#define gpio_to_bank(gpio) ((gpio) >> 5) + +/* NOTE: these macros are defined here to make optimization of + * gpio_{get,set}_value() to work when 'gpio' is a constant. + * Usage of these macros otherwise is no longer recommended, + * use generic GPIO API whenever possible. + */ +#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f)) + +#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00) +#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c) +#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18) +#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24) + +#include <plat/gpio-pxa.h> + +#endif /* __ASM_MACH_GPIO_PXA_H */ |