ARM: EXYNOS: skip wakeup interrupt setup if pinctrl driver is used
authorThomas Abraham <thomas.abraham@linaro.org>
Thu, 6 Sep 2012 21:07:40 +0000 (06:07 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Thu, 6 Sep 2012 21:07:40 +0000 (06:07 +0900)
Pinctrl driver includes support for configuring the external wakeup
interrupts. On exynos platforms that use pinctrl driver, the setup
of wakeup interrupts in the exynos platform code can be skipped.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-exynos/common.c

index 4eb39cdf75eab7b524ab090af5179315797107ce..715b690e5009608c9d9bfa42b1bb6e2d595b79ee 100644 (file)
@@ -980,6 +980,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