Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191770
b: refs/heads/master
c: d67d112
h: refs/heads/master
v: v3
  • Loading branch information
Rabin Vincent authored and Russell King committed May 4, 2010
1 parent 0c6b8ab commit a6c0a6b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 178980f98eef58607647eb66e178bf984bf81f4c
refs/heads/master: d67d1127a625cc5ebc3802180b19cc74f35b5578
30 changes: 0 additions & 30 deletions trunk/arch/arm/mach-ux500/cpu-u8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,6 @@
#include <mach/hardware.h>
#include <mach/setup.h>

#define GPIO_RESOURCE(block) \
{ \
.start = U8500_GPIOBANK##block##_BASE, \
.end = U8500_GPIOBANK##block##_BASE + 127, \
.flags = IORESOURCE_MEM, \
}, \
{ \
.start = IRQ_GPIO##block, \
.end = IRQ_GPIO##block, \
.flags = IORESOURCE_IRQ, \
}

#define GPIO_DEVICE(block) \
{ \
.name = "gpio", \
.id = block, \
.num_resources = 2, \
.resource = &u8500_gpio_resources[block * 2], \
.dev = { \
.platform_data = &u8500_gpio_data[block], \
}, \
}

#define GPIO_DATA(_name, first) \
{ \
.name = _name, \
.first_gpio = first, \
.first_irq = NOMADIK_GPIO_TO_IRQ(first), \
}

static struct nmk_gpio_platform_data u8500_gpio_data[] = {
GPIO_DATA("GPIO-0-31", 0),
GPIO_DATA("GPIO-32-63", 32), /* 37..63 not routed to pin */
Expand Down
38 changes: 38 additions & 0 deletions trunk/arch/arm/mach-ux500/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,42 @@

#include <plat/gpio.h>

#define __GPIO_RESOURCE(soc, block) \
{ \
.start = soc##_GPIOBANK##block##_BASE, \
.end = soc##_GPIOBANK##block##_BASE + 127, \
.flags = IORESOURCE_MEM, \
}, \
{ \
.start = IRQ_GPIO##block, \
.end = IRQ_GPIO##block, \
.flags = IORESOURCE_IRQ, \
}

#define __GPIO_DEVICE(soc, block) \
{ \
.name = "gpio", \
.id = block, \
.num_resources = 2, \
.resource = &soc##_gpio_resources[block * 2], \
.dev = { \
.platform_data = &soc##_gpio_data[block], \
}, \
}

#define GPIO_DATA(_name, first) \
{ \
.name = _name, \
.first_gpio = first, \
.first_irq = NOMADIK_GPIO_TO_IRQ(first), \
}

#ifdef CONFIG_UX500_SOC_DB8500
#define GPIO_RESOURCE(block) __GPIO_RESOURCE(U8500, block)
#define GPIO_DEVICE(block) __GPIO_DEVICE(u8500, block)
#elif defined(CONFIG_UX500_SOC_DB5500)
#define GPIO_RESOURCE(block) __GPIO_RESOURCE(U5500, block)
#define GPIO_DEVICE(block) __GPIO_DEVICE(u5500, block)
#endif

#endif /* __ASM_ARCH_GPIO_H */

0 comments on commit a6c0a6b

Please sign in to comment.