Merge branch 'next/cleanup-samsung' into next/cleanup-samsung-2
[~shefty/rdma-dev.git] / arch / arm / mach-exynos / common.c
index 0e8436176e3ba40effaaae77d680b4f732e6bca1..4e577f6e616422f4cc82a34037fe790d1e76b784 100644 (file)
@@ -47,6 +47,7 @@
 #include <plat/fimc-core.h>
 #include <plat/iic-core.h>
 #include <plat/tv-core.h>
+#include <plat/spi-core.h>
 #include <plat/regs-serial.h>
 
 #include "common.h"
@@ -330,6 +331,8 @@ static void __init exynos4_map_io(void)
 
        s5p_fb_setname(0, "exynos4-fb");
        s5p_hdmi_setname("exynos4-hdmi");
+
+       s3c64xx_spi_setname("exynos4210-spi");
 }
 
 static void __init exynos5_map_io(void)
@@ -350,6 +353,8 @@ static void __init exynos5_map_io(void)
        s3c_i2c0_setname("s3c2440-i2c");
        s3c_i2c1_setname("s3c2440-i2c");
        s3c_i2c2_setname("s3c2440-i2c");
+
+       s3c64xx_spi_setname("exynos4210-spi");
 }
 
 static void __init exynos4_init_clocks(int xtal)
@@ -961,6 +966,32 @@ static int __init exynos_init_irq_eint(void)
 {
        int irq;
 
+#ifdef CONFIG_PINCTRL_SAMSUNG
+       /*
+        * The Samsung pinctrl driver provides an integrated gpio/pinmux/pinconf
+        * functionality along with support for external gpio and wakeup
+        * interrupts. If the samsung pinctrl driver is enabled and includes
+        * the wakeup interrupt support, then the setting up external wakeup
+        * interrupts here can be skipped. This check here is temporary to
+        * allow exynos4 platforms that do not use Samsung pinctrl driver to
+        * co-exist with platforms that do. When all of the Samsung Exynos4
+        * platforms switch over to using the pinctrl driver, the wakeup
+        * interrupt support code here can be completely removed.
+        */
+       struct device_node *pctrl_np, *wkup_np;
+       const char *pctrl_compat = "samsung,pinctrl-exynos4210";
+       const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
+
+       for_each_compatible_node(pctrl_np, NULL, pctrl_compat) {
+               if (of_device_is_available(pctrl_np)) {
+                       wkup_np = of_find_compatible_node(pctrl_np, NULL,
+                                                       wkup_compat);
+                       if (wkup_np)
+                               return -ENODEV;
+               }
+       }
+#endif
+
        if (soc_is_exynos5250())
                exynos_eint_base = ioremap(EXYNOS5_PA_GPIO1, SZ_4K);
        else