/arch/arm/mm/

O_BA_HIGH_BYTE 0x60 #define GPIO_BA_LOW_BYTE 0x61 #define GPIO_IOSIZE 4 #define GPIO1X_IO 0xf0 #define GPIO2X_IO 0xf1 static u16 gpio_ba; static u8 read_reg(u8 addr, u8 port) { outb(addr, port); return inb(port + 1); } static void write_reg(u8 data, u8 addr, u8 port) { outb(addr, port); outb(data, port + 1); } static void enter_conf_mode(u8 port) { outb(0x87, port); outb(0x61, port); outb(0x55, port); outb((port == 0x2e) ? 0x55 : 0xaa, port); } static void exit_conf_mode(u8 port) { outb(0x2, port); outb(0x2, port + 1); } static void enter_gpio_mode(u8 port) { write_reg(0x2, 0x7, port); } static int it8761e_gpio_get(struct gpio_chip *gc, unsigned gpio_num) { u16 reg; u8 bit; bit = gpio_num % 8; reg = (gpio_num >= 8) ? gpio_ba + 1 : gpio_ba; return !!(inb(reg) & (1 << bit)); } static int it8761e_gpio_direction_in(struct gpio_chip *gc, unsigned gpio_num) {