Skip to content

Commit

Permalink
ARM: OMAP3+: PRM: register interrupt information from DT
Browse files Browse the repository at this point in the history
Allow the PRM interrupt information to be picked up from device tree.
OMAP3 may use legacy boot and needs to be compatible with old dtbs
(without interrupt populated), for these, we use the value which is
pre-populated.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
  • Loading branch information
Nishanth Menon committed Sep 8, 2014
1 parent 2aba071 commit 1e03779
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/arm/mach-omap2/prm3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/of_irq.h>

#include "soc.h"
#include "common.h"
Expand Down Expand Up @@ -649,13 +650,30 @@ int __init omap3xxx_prm_init(void)
return prm_register(&omap3xxx_prm_ll_data);
}

static struct of_device_id omap3_prm_dt_match_table[] = {
{ .compatible = "ti,omap3-prm" },
{ }
};

static int omap3xxx_prm_late_init(void)
{
int ret;

if (!(prm_features & PRM_HAS_IO_WAKEUP))
return 0;

if (of_have_populated_dt()) {
struct device_node *np;
int irq_num;

np = of_find_matching_node(NULL, omap3_prm_dt_match_table);
if (np) {
irq_num = of_irq_get(np, 0);
if (irq_num >= 0)
omap3_prcm_irq_setup.irq = irq_num;
}
}

omap3xxx_prm_enable_io_wakeup();
ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
if (!ret)
Expand Down

0 comments on commit 1e03779

Please sign in to comment.