blob: 332246d7c0fd4a2486267c41f1b0f41b505d06f0 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef __ASM_ARCH_OMAP_GPIO_H
13#define __ASM_ARCH_OMAP_GPIO_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <asm/hardware.h>
16#include <asm/arch/irqs.h>
17#include <asm/io.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080018
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019#define OMAP_MPUIO_BASE (void __iomem *)0xfffb5000
Ben Cheng4b29af02012-03-07 16:14:53 -080020
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#define OMAP_MPUIO_INPUT_LATCH 0x00
22#define OMAP_MPUIO_OUTPUT 0x04
23#define OMAP_MPUIO_IO_CNTL 0x08
24#define OMAP_MPUIO_KBR_LATCH 0x10
25#define OMAP_MPUIO_KBC 0x14
26#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
27#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
28#define OMAP_MPUIO_KBD_INT 0x20
29#define OMAP_MPUIO_GPIO_INT 0x24
30#define OMAP_MPUIO_KBD_MASKIT 0x28
31#define OMAP_MPUIO_GPIO_MASKIT 0x2c
32#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
33#define OMAP_MPUIO_LATCH 0x34
Ben Cheng4b29af02012-03-07 16:14:53 -080034
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
36#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
Ben Cheng4b29af02012-03-07 16:14:53 -080037
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080038#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? IH_MPUIO_BASE + ((nr) & 0x0f) : IH_GPIO_BASE + (nr))
Ben Cheng4b29af02012-03-07 16:14:53 -080039
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040struct omap_machine_gpio_bank {
41 int start;
42 int end;
Ben Cheng4b29af02012-03-07 16:14:53 -080043
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044 void (*set_gpio_direction)(int gpio, int is_input);
45 void (*set_gpio_dataout)(int gpio, int enable);
46 int (*get_gpio_datain)(int gpio);
47};
Ben Cheng4b29af02012-03-07 16:14:53 -080048
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#endif