diff options
author | Nishanth Menon <nm@ti.com> | 2014-05-22 16:19:29 -0400 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2014-09-08 11:53:45 -0400 |
commit | a8f83aefcd5a5ec6e420077946d88833a594eb42 (patch) | |
tree | 317624c504d5390b0992de4408f7e9890f2f42a9 | |
parent | 390ddc19e2a56c47b46f11a5ed0a7be8e695dd8a (diff) |
ARM: OMAP4+: PRM: register interrupt information from DT
Allow the PRM interrupt information to be picked up from device tree.
the only exception is for OMAP4 which uses values pre-populated and allows
compatibility with older dtb.
Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index d4d745e5e64b..5a70c91dea10 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/of_irq.h> | ||
20 | 21 | ||
21 | 22 | ||
22 | #include "soc.h" | 23 | #include "soc.h" |
@@ -699,11 +700,50 @@ int __init omap44xx_prm_init(void) | |||
699 | return prm_register(&omap44xx_prm_ll_data); | 700 | return prm_register(&omap44xx_prm_ll_data); |
700 | } | 701 | } |
701 | 702 | ||
703 | static struct of_device_id omap_prm_dt_match_table[] = { | ||
704 | { .compatible = "ti,omap4-prm" }, | ||
705 | { .compatible = "ti,omap5-prm" }, | ||
706 | { .compatible = "ti,dra7-prm" }, | ||
707 | { } | ||
708 | }; | ||
709 | |||
702 | static int omap44xx_prm_late_init(void) | 710 | static int omap44xx_prm_late_init(void) |
703 | { | 711 | { |
712 | struct device_node *np; | ||
713 | int irq_num; | ||
714 | |||
704 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) | 715 | if (!(prm_features & PRM_HAS_IO_WAKEUP)) |
705 | return 0; | 716 | return 0; |
706 | 717 | ||
718 | /* OMAP4+ is DT only now */ | ||
719 | if (!of_have_populated_dt()) | ||
720 | return 0; | ||
721 | |||
722 | np = of_find_matching_node(NULL, omap_prm_dt_match_table); | ||
723 | |||
724 | if (!np) { | ||
725 | /* Default loaded up with OMAP4 values */ | ||
726 | if (!cpu_is_omap44xx()) | ||
727 | return 0; | ||
728 | } else { | ||
729 | irq_num = of_irq_get(np, 0); | ||
730 | /* | ||
731 | * Already have OMAP4 IRQ num. For all other platforms, we need | ||
732 | * IRQ numbers from DT | ||
733 | */ | ||
734 | if (irq_num < 0 && !cpu_is_omap44xx()) { | ||
735 | if (irq_num == -EPROBE_DEFER) | ||
736 | return irq_num; | ||
737 | |||
738 | /* Have nothing to do */ | ||
739 | return 0; | ||
740 | } | ||
741 | |||
742 | /* Once OMAP4 DT is filled as well */ | ||
743 | if (irq_num >= 0) | ||
744 | omap4_prcm_irq_setup.irq = irq_num; | ||
745 | } | ||
746 | |||
707 | omap44xx_prm_enable_io_wakeup(); | 747 | omap44xx_prm_enable_io_wakeup(); |
708 | 748 | ||
709 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); | 749 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); |