aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5/mm.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-06-05 12:07:55 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-06-06 12:01:19 -0400
commitb78d8e59a6f611e229fab8ec3014c58eba975000 (patch)
treeaaf1a09f8b0dd9b8dff8a8625b5f5df3bfcd01aa /arch/arm/mach-mx5/mm.c
parentd37a65bb4663bde7cf3dbc51aec7f264fa4d0ebf (diff)
gpio/mxc: Change gpio-mxc into an upstanding gpio driver
The patch makes necessary changes on gpio-mxc as below to turn it into an upstanding gpio driver. * Add a list to save all mx2 ports references, so that mx2_gpio_irq_handler can walk through all interrupt status registers * Use readl/writel to replace mach-specific accessors __raw_readl/__raw_writel * Change mxc_gpio_init into mxc_gpio_probe function * Move "struct mxc_gpio_port" into gpio-mxc.c, as it needs not to be public at all, and also make some other cleanup on plat-mxc/include/mach/gpio.h at the same time And the patch then migrates mach-imx and mach-mx5 to the updated driver by adding corresponding platform devices. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-mx5/mm.c')
-rw-r--r--arch/arm/mach-mx5/mm.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index ff557301b42..800bb8b2108 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -69,8 +69,6 @@ void __init imx53_init_early(void)
69 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR)); 69 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
70} 70}
71 71
72int imx51_register_gpios(void);
73
74void __init mx51_init_irq(void) 72void __init mx51_init_irq(void)
75{ 73{
76 unsigned long tzic_addr; 74 unsigned long tzic_addr;
@@ -86,11 +84,8 @@ void __init mx51_init_irq(void)
86 panic("unable to map TZIC interrupt controller\n"); 84 panic("unable to map TZIC interrupt controller\n");
87 85
88 tzic_init_irq(tzic_virt); 86 tzic_init_irq(tzic_virt);
89 imx51_register_gpios();
90} 87}
91 88
92int imx53_register_gpios(void);
93
94void __init mx53_init_irq(void) 89void __init mx53_init_irq(void)
95{ 90{
96 unsigned long tzic_addr; 91 unsigned long tzic_addr;
@@ -103,5 +98,23 @@ void __init mx53_init_irq(void)
103 panic("unable to map TZIC interrupt controller\n"); 98 panic("unable to map TZIC interrupt controller\n");
104 99
105 tzic_init_irq(tzic_virt); 100 tzic_init_irq(tzic_virt);
106 imx53_register_gpios(); 101}
102
103void __init imx51_soc_init(void)
104{
105 mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
106 mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
107 mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
108 mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
109}
110
111void __init imx53_soc_init(void)
112{
113 mxc_register_gpio(0, MX53_GPIO1_BASE_ADDR, SZ_16K, MX53_INT_GPIO1_LOW, MX53_INT_GPIO1_HIGH);
114 mxc_register_gpio(1, MX53_GPIO2_BASE_ADDR, SZ_16K, MX53_INT_GPIO2_LOW, MX53_INT_GPIO2_HIGH);
115 mxc_register_gpio(2, MX53_GPIO3_BASE_ADDR, SZ_16K, MX53_INT_GPIO3_LOW, MX53_INT_GPIO3_HIGH);
116 mxc_register_gpio(3, MX53_GPIO4_BASE_ADDR, SZ_16K, MX53_INT_GPIO4_LOW, MX53_INT_GPIO4_HIGH);
117 mxc_register_gpio(4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH);
118 mxc_register_gpio(5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
119 mxc_register_gpio(6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
107} 120}