summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x/devices.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-04-26 17:47:29 +0200
committerOlof Johansson <olof@lixom.net>2013-06-12 00:44:57 +0200
commite328b88094b712e4010a805499ceff774e2795b7 (patch)
treea8388f1974daa4c65b40ff22909d2e157163aa83 /arch/arm/mach-clps711x/devices.c
parentGPIO: clps711x: Add DT support (diff)
downloadlinux-e328b88094b712e4010a805499ceff774e2795b7.tar.xz
linux-e328b88094b712e4010a805499ceff774e2795b7.zip
ARM: clps711x: Re-add GPIO support
arch_initcall was been removed from GPIO driver, so this patch re-add support for GPIO into boards as platform_device. Since some drivers (spi, nand, etc.) is not support deferred probe, separate machine init calls is used in board code to make proper loading sequence. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x/devices.c')
-rw-r--r--arch/arm/mach-clps711x/devices.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-clps711x/devices.c b/arch/arm/mach-clps711x/devices.c
new file mode 100644
index 000000000000..21161ed4c0c4
--- /dev/null
+++ b/arch/arm/mach-clps711x/devices.c
@@ -0,0 +1,48 @@
+/*
+ * CLPS711X common devices definitions
+ *
+ * Author: Alexander Shiyan <shc_work@mail.ru>, 2013
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/platform_device.h>
+
+#include <mach/hardware.h>
+
+static const phys_addr_t clps711x_gpios[][2] __initconst = {
+ { PADR, PADDR },
+ { PBDR, PBDDR },
+ { PCDR, PCDDR },
+ { PDDR, PDDDR },
+ { PEDR, PEDDR },
+};
+
+static void __init clps711x_add_gpio(void)
+{
+ unsigned i;
+ struct resource gpio_res[2];
+
+ memset(gpio_res, 0, sizeof(gpio_res));
+
+ gpio_res[0].flags = IORESOURCE_MEM;
+ gpio_res[1].flags = IORESOURCE_MEM;
+
+ for (i = 0; i < ARRAY_SIZE(clps711x_gpios); i++) {
+ gpio_res[0].start = CLPS711X_PHYS_BASE + clps711x_gpios[i][0];
+ gpio_res[0].end = gpio_res[0].start;
+ gpio_res[1].start = CLPS711X_PHYS_BASE + clps711x_gpios[i][1];
+ gpio_res[1].end = gpio_res[1].start;
+
+ platform_device_register_simple("clps711x-gpio", i,
+ gpio_res, ARRAY_SIZE(gpio_res));
+ }
+}
+
+void __init clps711x_devices_init(void)
+{
+ clps711x_add_gpio();
+}