diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-06-05 12:07:55 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-06 12:01:19 -0400 |
commit | b78d8e59a6f611e229fab8ec3014c58eba975000 (patch) | |
tree | aaf1a09f8b0dd9b8dff8a8625b5f5df3bfcd01aa /arch/arm/mach-imx/mm-imx27.c | |
parent | d37a65bb4663bde7cf3dbc51aec7f264fa4d0ebf (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-imx/mm-imx27.c')
-rw-r--r-- | arch/arm/mach-imx/mm-imx27.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index a6761a39f08c..d3700cec8ec5 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | #include <asm/pgtable.h> | 25 | #include <asm/pgtable.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <mach/gpio.h> | ||
28 | #include <mach/irqs.h> | 27 | #include <mach/irqs.h> |
29 | #include <mach/iomux-v1.h> | 28 | #include <mach/iomux-v1.h> |
30 | 29 | ||
@@ -70,17 +69,17 @@ void __init imx27_init_early(void) | |||
70 | MX27_NUM_GPIO_PORT); | 69 | MX27_NUM_GPIO_PORT); |
71 | } | 70 | } |
72 | 71 | ||
73 | static struct mxc_gpio_port imx27_gpio_ports[] = { | ||
74 | DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO), | ||
75 | DEFINE_IMX_GPIO_PORT(MX27, 1, 2), | ||
76 | DEFINE_IMX_GPIO_PORT(MX27, 2, 3), | ||
77 | DEFINE_IMX_GPIO_PORT(MX27, 3, 4), | ||
78 | DEFINE_IMX_GPIO_PORT(MX27, 4, 5), | ||
79 | DEFINE_IMX_GPIO_PORT(MX27, 5, 6), | ||
80 | }; | ||
81 | |||
82 | void __init mx27_init_irq(void) | 72 | void __init mx27_init_irq(void) |
83 | { | 73 | { |
84 | mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR)); | 74 | mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR)); |
85 | mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports)); | 75 | } |
76 | |||
77 | void __init imx27_soc_init(void) | ||
78 | { | ||
79 | mxc_register_gpio(0, MX27_GPIO1_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
80 | mxc_register_gpio(1, MX27_GPIO2_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
81 | mxc_register_gpio(2, MX27_GPIO3_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
82 | mxc_register_gpio(3, MX27_GPIO4_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
83 | mxc_register_gpio(4, MX27_GPIO5_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
84 | mxc_register_gpio(5, MX27_GPIO6_BASE_ADDR, SZ_4K, MX27_INT_GPIO, 0); | ||
86 | } | 85 | } |