summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx3/devices.c
diff options
context:
space:
mode:
authorJuergen Beisert <j.beisert@pengutronix.de>2008-07-05 08:02:49 (GMT)
committerRobert Schwebel <r.schwebel@pengutronix.de>2008-07-05 08:02:49 (GMT)
commit07bd1a6cc7cbb3f373fbe49b204c6cde5e9155fc (patch)
tree94a09785b99feebe4c83e836a976fe7fbf146813 /arch/arm/mach-mx3/devices.c
parente3d13ff4b9d3b05d7a969153e2c049548e25deea (diff)
downloadlinux-07bd1a6cc7cbb3f373fbe49b204c6cde5e9155fc.tar.xz
MXC arch: Add gpio support for the whole platform
This patch bases on the one from Daniel Mack. The most important change to Daniel's patch is to be more generic. This gpio routine supports at least the i.MX27 and i.MX31 processors. Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de> Acked-by: Daniel Mack <daniel@caiaq.de>
Diffstat (limited to 'arch/arm/mach-mx3/devices.c')
-rw-r--r--arch/arm/mach-mx3/devices.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 1bc6d23..5c0320f 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/serial.h>
+#include <linux/gpio.h>
#include <asm/hardware.h>
#include <asm/arch/imx-uart.h>
@@ -151,3 +152,29 @@ int __init imx_init_uart(int uart_no, struct imxuart_platform_data *pdata)
return 0;
}
+/* GPIO port description */
+static struct mxc_gpio_port imx_gpio_ports[] = {
+ [0] = {
+ .chip.label = "gpio-0",
+ .base = IO_ADDRESS(GPIO1_BASE_ADDR),
+ .irq = MXC_INT_GPIO1,
+ .virtual_irq_start = MXC_GPIO_INT_BASE
+ },
+ [1] = {
+ .chip.label = "gpio-1",
+ .base = IO_ADDRESS(GPIO2_BASE_ADDR),
+ .irq = MXC_INT_GPIO2,
+ .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN
+ },
+ [2] = {
+ .chip.label = "gpio-2",
+ .base = IO_ADDRESS(GPIO3_BASE_ADDR),
+ .irq = MXC_INT_GPIO3,
+ .virtual_irq_start = MXC_GPIO_INT_BASE + GPIO_NUM_PIN * 2
+ }
+};
+
+int __init mxc_register_gpios(void)
+{
+ return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
+}