diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2010-12-14 06:54:03 -0500 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-03-03 16:27:02 -0500 |
commit | 9eac6d0a4e7e5149a7f86575b46d710ad2e05fe2 (patch) | |
tree | 3f3eb4504f3221954a5adaae66e417d9a0883e71 /arch/arm/mach-dove/include | |
parent | 4ee1f6b574765a6c97f945e6b0277e5ccac38cb5 (diff) |
ARM: Remove dependency of plat-orion GPIO code on mach directory includes.
This patch makes the various mach dirs that use the plat-orion GPIO
code pass in GPIO-related platform info (GPIO controller base address,
secondary base IRQ number, etc) explicitly, instead of having
plat-orion get those values by including a mach dir include file --
the latter mechanism is problematic if you want to support multiple
ARM platforms in the same kernel image.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/mach-dove/include')
-rw-r--r-- | arch/arm/mach-dove/include/mach/dove.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-dove/include/mach/gpio.h | 42 |
2 files changed, 2 insertions, 43 deletions
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h index 27b414578f2e..e5fcdd3f5bf5 100644 --- a/arch/arm/mach-dove/include/mach/dove.h +++ b/arch/arm/mach-dove/include/mach/dove.h | |||
@@ -130,7 +130,8 @@ | |||
130 | #define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10) | 130 | #define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10) |
131 | #define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) | 131 | #define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) |
132 | #define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) | 132 | #define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) |
133 | #define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) | 133 | #define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) |
134 | #define DOVE_GPIO_HI_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0420) | ||
134 | #define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400) | 135 | #define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400) |
135 | #define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) | 136 | #define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) |
136 | #define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) | 137 | #define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) |
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h index 340bb7af529d..e7e5101e35a5 100644 --- a/arch/arm/mach-dove/include/mach/gpio.h +++ b/arch/arm/mach-dove/include/mach/gpio.h | |||
@@ -6,46 +6,4 @@ | |||
6 | * warranty of any kind, whether express or implied. | 6 | * warranty of any kind, whether express or implied. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef __ASM_ARCH_GPIO_H | ||
10 | #define __ASM_ARCH_GPIO_H | ||
11 | |||
12 | #include <asm/errno.h> | ||
13 | #include <mach/irqs.h> | ||
14 | #include <plat/gpio.h> | 9 | #include <plat/gpio.h> |
15 | #include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
16 | |||
17 | #define GPIO_MAX 72 | ||
18 | |||
19 | #define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00) | ||
20 | #define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20) | ||
21 | |||
22 | #define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : \ | ||
23 | ((pin < 64) ? GPIO_BASE_HI : \ | ||
24 | DOVE_GPIO2_VIRT_BASE)) | ||
25 | |||
26 | #define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00) | ||
27 | #define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04) | ||
28 | #define GPIO_BLINK_EN(pin) (GPIO_BASE(pin) + 0x08) | ||
29 | #define GPIO_IN_POL(pin) (GPIO_BASE(pin) + 0x0c) | ||
30 | #define GPIO_DATA_IN(pin) (GPIO_BASE(pin) + 0x10) | ||
31 | #define GPIO_EDGE_CAUSE(pin) (GPIO_BASE(pin) + 0x14) | ||
32 | #define GPIO_EDGE_MASK(pin) (GPIO_BASE(pin) + 0x18) | ||
33 | #define GPIO_LEVEL_MASK(pin) (GPIO_BASE(pin) + 0x1c) | ||
34 | |||
35 | static inline int gpio_to_irq(int pin) | ||
36 | { | ||
37 | if (pin < NR_GPIO_IRQS) | ||
38 | return pin + IRQ_DOVE_GPIO_START; | ||
39 | |||
40 | return -EINVAL; | ||
41 | } | ||
42 | |||
43 | static inline int irq_to_gpio(int irq) | ||
44 | { | ||
45 | if (IRQ_DOVE_GPIO_START < irq && irq < NR_IRQS) | ||
46 | return irq - IRQ_DOVE_GPIO_START; | ||
47 | |||
48 | return -EINVAL; | ||
49 | } | ||
50 | |||
51 | #endif | ||