Path: blob/master/arch/arm/mach-mmp/include/mach/gpio.h
15162 views
#ifndef __ASM_MACH_GPIO_H1#define __ASM_MACH_GPIO_H23#include <mach/addr-map.h>4#include <mach/irqs.h>5#include <asm-generic/gpio.h>67#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000)89#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))10#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))1112#define NR_BUILTIN_GPIO IRQ_GPIO_NUM1314#define gpio_to_bank(gpio) ((gpio) >> 5)15#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))16#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)171819#define __gpio_is_inverted(gpio) (0)20#define __gpio_is_occupied(gpio) (0)2122/* NOTE: these macros are defined here to make optimization of23* gpio_{get,set}_value() to work when 'gpio' is a constant.24* Usage of these macros otherwise is no longer recommended,25* use generic GPIO API whenever possible.26*/27#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f))2829#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)30#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)31#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)32#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)3334#include <plat/gpio.h>35#endif /* __ASM_MACH_GPIO_H */363738