aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-01-26 02:45:32 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-01-26 02:45:32 -0500
commit126186a055d965d5a7b1ab560e343ef70694f349 (patch)
treee4b88a405711760a043994ba910578e8df8d60a5
parente60bd7f14dbb6239d07676be420a21f8a36d014f (diff)
[POWERPC] 83xx: Return a point to the struct ipic from ipic_init()
It's useful to have access to struct ipic handle that just got created in ipic_init(). For example, if we want to setup an external IRQ with out a device node we need access ipic->irqhost to create the virtual to HW IRQ mapping and to set the IRQ sense. With this we can mimic the old sense array concept that existed in arch/ppc. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/sysdev/ipic.c15
-rw-r--r--include/asm-powerpc/ipic.h2
2 files changed, 10 insertions, 7 deletions
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 522aa14e8f0d..473c415e9e25 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -557,8 +557,7 @@ static struct irq_host_ops ipic_host_ops = {
557 .xlate = ipic_host_xlate, 557 .xlate = ipic_host_xlate,
558}; 558};
559 559
560void __init ipic_init(struct device_node *node, 560struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
561 unsigned int flags)
562{ 561{
563 struct ipic *ipic; 562 struct ipic *ipic;
564 struct resource res; 563 struct resource res;
@@ -566,7 +565,7 @@ void __init ipic_init(struct device_node *node,
566 565
567 ipic = alloc_bootmem(sizeof(struct ipic)); 566 ipic = alloc_bootmem(sizeof(struct ipic));
568 if (ipic == NULL) 567 if (ipic == NULL)
569 return; 568 return NULL;
570 569
571 memset(ipic, 0, sizeof(struct ipic)); 570 memset(ipic, 0, sizeof(struct ipic));
572 ipic->of_node = of_node_get(node); 571 ipic->of_node = of_node_get(node);
@@ -576,12 +575,14 @@ void __init ipic_init(struct device_node *node,
576 &ipic_host_ops, 0); 575 &ipic_host_ops, 0);
577 if (ipic->irqhost == NULL) { 576 if (ipic->irqhost == NULL) {
578 of_node_put(node); 577 of_node_put(node);
579 return; 578 return NULL;
580 } 579 }
581 580
582 ret = of_address_to_resource(node, 0, &res); 581 ret = of_address_to_resource(node, 0, &res);
583 if (ret) 582 if (ret) {
584 return; 583 of_node_put(node);
584 return NULL;
585 }
585 586
586 ipic->regs = ioremap(res.start, res.end - res.start + 1); 587 ipic->regs = ioremap(res.start, res.end - res.start + 1);
587 588
@@ -625,6 +626,8 @@ void __init ipic_init(struct device_node *node,
625 626
626 printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS, 627 printk ("IPIC (%d IRQ sources) at %p\n", NR_IPIC_INTS,
627 primary_ipic->regs); 628 primary_ipic->regs);
629
630 return ipic;
628} 631}
629 632
630int ipic_set_priority(unsigned int virq, unsigned int priority) 633int ipic_set_priority(unsigned int virq, unsigned int priority)
diff --git a/include/asm-powerpc/ipic.h b/include/asm-powerpc/ipic.h
index 9fbb03415860..edec79dcb7c1 100644
--- a/include/asm-powerpc/ipic.h
+++ b/include/asm-powerpc/ipic.h
@@ -78,7 +78,7 @@ extern u32 ipic_get_mcp_status(void);
78extern void ipic_clear_mcp_status(u32 mask); 78extern void ipic_clear_mcp_status(u32 mask);
79 79
80#ifdef CONFIG_PPC_MERGE 80#ifdef CONFIG_PPC_MERGE
81extern void ipic_init(struct device_node *node, unsigned int flags); 81extern struct ipic * ipic_init(struct device_node *node, unsigned int flags);
82extern unsigned int ipic_get_irq(void); 82extern unsigned int ipic_get_irq(void);
83#else 83#else
84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, 84extern void ipic_init(phys_addr_t phys_addr, unsigned int flags,