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-imx35.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-imx35.c')
-rw-r--r-- | arch/arm/mach-imx/mm-imx35.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/arm/mach-imx/mm-imx35.c b/arch/arm/mach-imx/mm-imx35.c index c880e6d1ae55..648bfca0163e 100644 --- a/arch/arm/mach-imx/mm-imx35.c +++ b/arch/arm/mach-imx/mm-imx35.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <mach/common.h> | 27 | #include <mach/common.h> |
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/iomux-v3.h> | 29 | #include <mach/iomux-v3.h> |
30 | #include <mach/gpio.h> | ||
31 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
32 | 31 | ||
33 | static struct map_desc mx35_io_desc[] __initdata = { | 32 | static struct map_desc mx35_io_desc[] __initdata = { |
@@ -50,14 +49,14 @@ void __init imx35_init_early(void) | |||
50 | mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); | 49 | mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); |
51 | } | 50 | } |
52 | 51 | ||
53 | static struct mxc_gpio_port imx35_gpio_ports[] = { | ||
54 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1), | ||
55 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2), | ||
56 | DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3), | ||
57 | }; | ||
58 | |||
59 | void __init mx35_init_irq(void) | 52 | void __init mx35_init_irq(void) |
60 | { | 53 | { |
61 | mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR)); | 54 | mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR)); |
62 | mxc_gpio_init(imx35_gpio_ports, ARRAY_SIZE(imx35_gpio_ports)); | 55 | } |
56 | |||
57 | void __init imx35_soc_init(void) | ||
58 | { | ||
59 | mxc_register_gpio(0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0); | ||
60 | mxc_register_gpio(1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0); | ||
61 | mxc_register_gpio(2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0); | ||
63 | } | 62 | } |