aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-11 12:50:50 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-19 15:54:34 -0500
commitd7e0951f929513ced7c57882d2f95d49a546e002 (patch)
treeda72b67a4e988a95fe93e3422dcc6ed52d7e4341
parent972cc48207450ce6aeed416ac176fe4d0482a4a3 (diff)
ARM: mx3: move registration of gpios to plat-mxc/gpio.c
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx3/devices.c28
-rw-r--r--arch/arm/mach-mx3/mm.c23
-rw-r--r--arch/arm/plat-mxc/gpio.c22
3 files changed, 34 insertions, 39 deletions
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 5808ce1b157b..b179f70b057d 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -29,31 +29,6 @@
29 29
30#include "devices.h" 30#include "devices.h"
31 31
32/* GPIO port description */
33static struct mxc_gpio_port imx_gpio_ports[] = {
34 {
35 .chip.label = "gpio-0",
36 .base = MX31_IO_ADDRESS(MX31_GPIO1_BASE_ADDR),
37 .irq = MX3x_INT_GPIO1,
38 .virtual_irq_start = MXC_GPIO_IRQ_START,
39 }, {
40 .chip.label = "gpio-1",
41 .base = MX31_IO_ADDRESS(MX31_GPIO2_BASE_ADDR),
42 .irq = MX3x_INT_GPIO2,
43 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
44 }, {
45 .chip.label = "gpio-2",
46 .base = MX31_IO_ADDRESS(MX31_GPIO3_BASE_ADDR),
47 .irq = MX3x_INT_GPIO3,
48 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
49 }
50};
51
52int __init imx3x_register_gpios(void)
53{
54 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
55}
56
57#ifdef CONFIG_ARCH_MX31 32#ifdef CONFIG_ARCH_MX31
58static struct resource mxcsdhc0_resources[] = { 33static struct resource mxcsdhc0_resources[] = {
59 { 34 {
@@ -330,9 +305,6 @@ static int __init mx3_devices_init(void)
330#endif 305#endif
331#if defined(CONFIG_ARCH_MX35) 306#if defined(CONFIG_ARCH_MX35)
332 if (cpu_is_mx35()) { 307 if (cpu_is_mx35()) {
333 imx_gpio_ports[0].base = MX35_IO_ADDRESS(MX35_GPIO1_BASE_ADDR),
334 imx_gpio_ports[1].base = MX35_IO_ADDRESS(MX35_GPIO2_BASE_ADDR),
335 imx_gpio_ports[2].base = MX35_IO_ADDRESS(MX35_GPIO3_BASE_ADDR),
336 otg_resources[0].start = MX35_OTG_BASE_ADDR; 308 otg_resources[0].start = MX35_OTG_BASE_ADDR;
337 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff; 309 otg_resources[0].end = MX35_OTG_BASE_ADDR + 0x1ff;
338 otg_resources[1].start = MX35_INT_USBOTG; 310 otg_resources[1].start = MX35_INT_USBOTG;
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 193c18cd5304..998c3d7f1f22 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -57,7 +57,14 @@ void __init mx31_map_io(void)
57 57
58 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); 58 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
59} 59}
60#endif 60
61int imx31_register_gpios(void);
62void __init mx31_init_irq(void)
63{
64 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
65 imx31_register_gpios();
66}
67#endif /* ifdef CONFIG_ARCH_MX31 */
61 68
62#ifdef CONFIG_ARCH_MX35 69#ifdef CONFIG_ARCH_MX35
63static struct map_desc mx35_io_desc[] __initdata = { 70static struct map_desc mx35_io_desc[] __initdata = {
@@ -76,20 +83,14 @@ void __init mx35_map_io(void)
76 83
77 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc)); 84 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
78} 85}
79#endif
80
81int imx3x_register_gpios(void);
82
83void __init mx31_init_irq(void)
84{
85 mxc_init_irq(MX31_IO_ADDRESS(MX3x_AVIC_BASE_ADDR));
86 imx3x_register_gpios();
87}
88 86
87int imx35_register_gpios(void);
89void __init mx35_init_irq(void) 88void __init mx35_init_irq(void)
90{ 89{
91 mx31_init_irq(); 90 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
91 imx35_register_gpios();
92} 92}
93#endif /* ifdef CONFIG_ARCH_MX35 */
93 94
94#ifdef CONFIG_CACHE_L2X0 95#ifdef CONFIG_CACHE_L2X0
95static int mxc_init_l2x0(void) 96static int mxc_init_l2x0(void)
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index c853bfa3dc53..2fb1efa3d0fb 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -420,3 +420,25 @@ static struct mxc_gpio_port imx27_gpio_ports[] = {
420DEFINE_REGISTER_FUNCTION(imx27) 420DEFINE_REGISTER_FUNCTION(imx27)
421 421
422#endif /* if defined(CONFIG_SOC_IMX27) */ 422#endif /* if defined(CONFIG_SOC_IMX27) */
423
424#if defined(CONFIG_ARCH_MX31)
425static struct mxc_gpio_port imx31_gpio_ports[] = {
426 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 0, 1, MX31_INT_GPIO1),
427 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 1, 2, MX31_INT_GPIO2),
428 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 2, 3, MX31_INT_GPIO3),
429};
430
431DEFINE_REGISTER_FUNCTION(imx31)
432
433#endif /* if defined(CONFIG_ARCH_MX31) */
434
435#if defined(CONFIG_ARCH_MX35)
436static struct mxc_gpio_port imx35_gpio_ports[] = {
437 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1),
438 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2),
439 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3),
440};
441
442DEFINE_REGISTER_FUNCTION(imx35)
443
444#endif /* if defined(CONFIG_ARCH_MX35) */