ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap
authorTony Lindgren <tony@atomide.com>
Thu, 10 Oct 2013 22:45:13 +0000 (15:45 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 10 Oct 2013 22:46:30 +0000 (15:46 -0700)
Now pinctrl-single-omap can handle the wake-up events for us now
as long as the events are configured in the .dts files.

Done in collaboration with Roger Quadros <rogerq@ti.com>.

Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Prakash Manjunathappa <prakash.pm@ti.com>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/dts/omap3.dtsi
arch/arm/boot/dts/omap4.dtsi
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/pdata-quirks.c
arch/arm/mach-omap2/prm3xxx.h
arch/arm/mach-omap2/prm44xx_54xx.h
arch/arm/mach-omap2/prm_common.c

index 7d95cda1fae4f0349bdfb582de99be2baf36dbf6..695e2d34c9c62e2935d25dec02a252fb70fd6183 100644 (file)
                        reg = <0x48002030 0x05cc>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
                        pinctrl-single,register-width = <16>;
                        pinctrl-single,function-mask = <0x7f1f>;
                };
                        reg = <0x48002a00 0x5c>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
                        pinctrl-single,register-width = <16>;
                        pinctrl-single,function-mask = <0x7f1f>;
                };
index 22d9f2b593d461eb5bde36a35f24e2eaea40e298..0415d5ed601458428db5e1dea69f727edbf8e395 100644 (file)
                        reg = <0x4a100040 0x0196>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
                        pinctrl-single,register-width = <16>;
                        pinctrl-single,function-mask = <0x7fff>;
                };
                        reg = <0x4a31e040 0x0038>;
                        #address-cells = <1>;
                        #size-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
                        pinctrl-single,register-width = <16>;
                        pinctrl-single,function-mask = <0x7fff>;
                };
index f82cf878d6af41da87b8bb444acd609105af72a9..48094b58c88f775f592d77f8403b2a1d65cf1840 100644 (file)
@@ -811,6 +811,12 @@ int __init omap_mux_late_init(void)
                }
        }
 
+       omap_mux_dbg_init();
+
+       /* see pinctrl-single-omap for the wake-up interrupt handling */
+       if (of_have_populated_dt())
+               return 0;
+
        ret = request_irq(omap_prcm_event_to_irq("io"),
                omap_hwmod_mux_handle_irq, IRQF_SHARED | IRQF_NO_SUSPEND,
                        "hwmod_io", omap_mux_late_init);
@@ -818,8 +824,6 @@ int __init omap_mux_late_init(void)
        if (ret)
                pr_warning("mux: Failed to setup hwmod io irq %d\n", ret);
 
-       omap_mux_dbg_init();
-
        return 0;
 }
 
index 76abc5b63d6d1952af6f96df4ec95ad0bed0f780..18afbde020f7fe4a2bc337ac75e89e7b4241886a 100644 (file)
@@ -14,6 +14,8 @@
 #include <linux/of_platform.h>
 #include <linux/wl12xx.h>
 
+#include <linux/platform_data/pinctrl-single.h>
+
 #include "common.h"
 #include "common-board-devices.h"
 #include "dss-common.h"
@@ -105,7 +107,23 @@ static void __init omap5_uevm_legacy_init(void)
 }
 #endif
 
+static struct pcs_pdata pcs_pdata;
+
+void omap_pcs_legacy_init(int irq, void (*rearm)(void))
+{
+       pcs_pdata.irq = irq;
+       pcs_pdata.rearm = rearm;
+}
+
 struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
+#ifdef CONFIG_ARCH_OMAP3
+       OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
+       OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
+#endif
+#ifdef CONFIG_ARCH_OMAP4
+       OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
+       OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
+#endif
        { /* sentinel */ },
 };
 
index 277f71794e61adc9016212de3f9ae05efb87fd1c..f8eb83323b1a068271c5e222471706bb5d1c1708 100644 (file)
@@ -144,7 +144,13 @@ extern u32 omap3_prm_vcvp_read(u8 offset);
 extern void omap3_prm_vcvp_write(u32 val, u8 offset);
 extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
 
-extern void omap3xxx_prm_reconfigure_io_chain(void);
+#ifdef CONFIG_ARCH_OMAP3
+void omap3xxx_prm_reconfigure_io_chain(void);
+#else
+static inline void omap3xxx_prm_reconfigure_io_chain(void)
+{
+}
+#endif
 
 /* PRM interrupt-related functions */
 extern void omap3xxx_prm_read_pending_irqs(unsigned long *events);
index 7cd22abb8f15b54628dbc96b872fea903c7cdb95..a085d9cc1f5d0c01fbe02e2f490e18037e450a33 100644 (file)
@@ -42,7 +42,13 @@ extern u32 omap4_prm_vcvp_read(u8 offset);
 extern void omap4_prm_vcvp_write(u32 val, u8 offset);
 extern u32 omap4_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset);
 
-extern void omap44xx_prm_reconfigure_io_chain(void);
+#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
+void omap44xx_prm_reconfigure_io_chain(void);
+#else
+static inline void omap44xx_prm_reconfigure_io_chain(void)
+{
+}
+#endif
 
 /* PRM interrupt-related functions */
 extern void omap44xx_prm_read_pending_irqs(unsigned long *events);
index 228b850e632f6be77894b9d75a7162a105fd6889..a2e1174ad1b6a6632ad904e4a0b8c5f37dea1e79 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 
+#include "soc.h"
 #include "prm2xxx_3xxx.h"
 #include "prm2xxx.h"
 #include "prm3xxx.h"
@@ -322,6 +323,16 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
                prcm_irq_chips[i] = gc;
        }
 
+       if (of_have_populated_dt()) {
+               int irq = omap_prcm_event_to_irq("io");
+               if (cpu_is_omap34xx())
+                       omap_pcs_legacy_init(irq,
+                               omap3xxx_prm_reconfigure_io_chain);
+               else
+                       omap_pcs_legacy_init(irq,
+                               omap44xx_prm_reconfigure_io_chain);
+       }
+
        return 0;
 
 err: