[PATCH v2 03/11] ARM i.MX1: add imx-gpio devices
Steffen Trumtrar
s.trumtrar at pengutronix.de
Mon Sep 3 04:18:10 EDT 2012
Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
---
arch/arm/mach-imx/Kconfig | 1 +
arch/arm/mach-imx/imx1.c | 18 +++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index ce5edaa..112dcb1 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -148,6 +148,7 @@ choice
config ARCH_IMX1
bool "i.MX1"
+ select GPIOLIB
select CPU_ARM920T
config ARCH_IMX21
diff --git a/arch/arm/mach-imx/imx1.c b/arch/arm/mach-imx/imx1.c
index 742a260..bdd4f74 100644
--- a/arch/arm/mach-imx/imx1.c
+++ b/arch/arm/mach-imx/imx1.c
@@ -19,13 +19,13 @@
#include "gpio.h"
-void *imx_gpio_base[] = {
- (void *)0x0021c000,
- (void *)0x0021c100,
- (void *)0x0021c200,
- (void *)0x0021c300,
-};
-
-int imx_gpio_count = ARRAY_SIZE(imx_gpio_base) * 32;
-
+static int imx1_init(void)
+{
+ add_generic_device("imx-gpio", 0, NULL, 0x0021c000, 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("imx-gpio", 1, NULL, 0x0021c100, 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("imx-gpio", 2, NULL, 0x0021c200, 0x100, IORESOURCE_MEM, NULL);
+ add_generic_device("imx-gpio", 3, NULL, 0x0021c300, 0x100, IORESOURCE_MEM, NULL);
+ return 0;
+}
+coredevice_initcall(imx1_init);
--
1.7.10.4
More information about the barebox
mailing list