diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2010-05-03 02:43:48 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-04 12:50:02 -0400 |
commit | d67d1127a625cc5ebc3802180b19cc74f35b5578 (patch) | |
tree | bfc7b59e93c3dbe3ad76757c9e9b622913cadeb0 /arch/arm/mach-ux500 | |
parent | 178980f98eef58607647eb66e178bf984bf81f4c (diff) |
ARM: 6081/1: ux500: move gpio macros to common header
Move GPIO macros to a common header, and allow them to use the correct
macros for the appropriate SoC, and be named accordingly.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/cpu-u8500.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/gpio.h | 38 |
2 files changed, 38 insertions, 30 deletions
diff --git a/arch/arm/mach-ux500/cpu-u8500.c b/arch/arm/mach-ux500/cpu-u8500.c index 2c8aa93dca6e..c80beca0f977 100644 --- a/arch/arm/mach-ux500/cpu-u8500.c +++ b/arch/arm/mach-ux500/cpu-u8500.c | |||
@@ -23,36 +23,6 @@ | |||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/setup.h> | 24 | #include <mach/setup.h> |
25 | 25 | ||
26 | #define GPIO_RESOURCE(block) \ | ||
27 | { \ | ||
28 | .start = U8500_GPIOBANK##block##_BASE, \ | ||
29 | .end = U8500_GPIOBANK##block##_BASE + 127, \ | ||
30 | .flags = IORESOURCE_MEM, \ | ||
31 | }, \ | ||
32 | { \ | ||
33 | .start = IRQ_GPIO##block, \ | ||
34 | .end = IRQ_GPIO##block, \ | ||
35 | .flags = IORESOURCE_IRQ, \ | ||
36 | } | ||
37 | |||
38 | #define GPIO_DEVICE(block) \ | ||
39 | { \ | ||
40 | .name = "gpio", \ | ||
41 | .id = block, \ | ||
42 | .num_resources = 2, \ | ||
43 | .resource = &u8500_gpio_resources[block * 2], \ | ||
44 | .dev = { \ | ||
45 | .platform_data = &u8500_gpio_data[block], \ | ||
46 | }, \ | ||
47 | } | ||
48 | |||
49 | #define GPIO_DATA(_name, first) \ | ||
50 | { \ | ||
51 | .name = _name, \ | ||
52 | .first_gpio = first, \ | ||
53 | .first_irq = NOMADIK_GPIO_TO_IRQ(first), \ | ||
54 | } | ||
55 | |||
56 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { | 26 | static struct nmk_gpio_platform_data u8500_gpio_data[] = { |
57 | GPIO_DATA("GPIO-0-31", 0), | 27 | GPIO_DATA("GPIO-0-31", 0), |
58 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ | 28 | GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */ |
diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h index 3c4cd31ad9f7..d548a622e7d2 100644 --- a/arch/arm/mach-ux500/include/mach/gpio.h +++ b/arch/arm/mach-ux500/include/mach/gpio.h | |||
@@ -9,4 +9,42 @@ | |||
9 | 9 | ||
10 | #include <plat/gpio.h> | 10 | #include <plat/gpio.h> |
11 | 11 | ||
12 | #define __GPIO_RESOURCE(soc, block) \ | ||
13 | { \ | ||
14 | .start = soc##_GPIOBANK##block##_BASE, \ | ||
15 | .end = soc##_GPIOBANK##block##_BASE + 127, \ | ||
16 | .flags = IORESOURCE_MEM, \ | ||
17 | }, \ | ||
18 | { \ | ||
19 | .start = IRQ_GPIO##block, \ | ||
20 | .end = IRQ_GPIO##block, \ | ||
21 | .flags = IORESOURCE_IRQ, \ | ||
22 | } | ||
23 | |||
24 | #define __GPIO_DEVICE(soc, block) \ | ||
25 | { \ | ||
26 | .name = "gpio", \ | ||
27 | .id = block, \ | ||
28 | .num_resources = 2, \ | ||
29 | .resource = &soc##_gpio_resources[block * 2], \ | ||
30 | .dev = { \ | ||
31 | .platform_data = &soc##_gpio_data[block], \ | ||
32 | }, \ | ||
33 | } | ||
34 | |||
35 | #define GPIO_DATA(_name, first) \ | ||
36 | { \ | ||
37 | .name = _name, \ | ||
38 | .first_gpio = first, \ | ||
39 | .first_irq = NOMADIK_GPIO_TO_IRQ(first), \ | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
43 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block) | ||
44 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block) | ||
45 | #elif defined(CONFIG_UX500_SOC_DB5500) | ||
46 | #define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block) | ||
47 | #define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block) | ||
48 | #endif | ||
49 | |||
12 | #endif /* __ASM_ARCH_GPIO_H */ | 50 | #endif /* __ASM_ARCH_GPIO_H */ |