aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-10-26 22:36:43 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-10-26 22:36:43 -0400
commit9b798d50df3a98d22a6cbae565d9f4f630d161a6 (patch)
tree51ea0f11a29fedd14b1c0ff70fcbef87509aea12 /drivers/sh
parent0a993b0a290a2672500000b0ce811efc093f8467 (diff)
sh: intc: Make ack_regs generally available.
Currently this is ifdef'ed under SH-3 and SH-4A, but there are other CPUs that will need this as well. Given the size of the existing data structures, this doesn't cause any additional cacheline utilization for the existing users, so has no direct impact on the data structures. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/intc.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c
index 559b5fe9dc0f..94e6e46ff82c 100644
--- a/drivers/sh/intc.c
+++ b/drivers/sh/intc.c
@@ -70,9 +70,7 @@ static LIST_HEAD(intc_list);
70#endif 70#endif
71 71
72static unsigned int intc_prio_level[NR_IRQS]; /* for now */ 72static unsigned int intc_prio_level[NR_IRQS]; /* for now */
73#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
74static unsigned long ack_handle[NR_IRQS]; 73static unsigned long ack_handle[NR_IRQS];
75#endif
76 74
77static inline struct intc_desc_int *get_intc_desc(unsigned int irq) 75static inline struct intc_desc_int *get_intc_desc(unsigned int irq)
78{ 76{
@@ -250,7 +248,6 @@ static int intc_set_wake(unsigned int irq, unsigned int on)
250 return 0; /* allow wakeup, but setup hardware in intc_suspend() */ 248 return 0; /* allow wakeup, but setup hardware in intc_suspend() */
251} 249}
252 250
253#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
254static void intc_mask_ack(unsigned int irq) 251static void intc_mask_ack(unsigned int irq)
255{ 252{
256 struct intc_desc_int *d = get_intc_desc(irq); 253 struct intc_desc_int *d = get_intc_desc(irq);
@@ -282,7 +279,6 @@ static void intc_mask_ack(unsigned int irq)
282 } 279 }
283 } 280 }
284} 281}
285#endif
286 282
287static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp, 283static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp,
288 unsigned int nr_hp, 284 unsigned int nr_hp,
@@ -501,7 +497,6 @@ static unsigned int __init intc_prio_data(struct intc_desc *desc,
501 return 0; 497 return 0;
502} 498}
503 499
504#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
505static unsigned int __init intc_ack_data(struct intc_desc *desc, 500static unsigned int __init intc_ack_data(struct intc_desc *desc,
506 struct intc_desc_int *d, 501 struct intc_desc_int *d,
507 intc_enum enum_id) 502 intc_enum enum_id)
@@ -533,7 +528,6 @@ static unsigned int __init intc_ack_data(struct intc_desc *desc,
533 528
534 return 0; 529 return 0;
535} 530}
536#endif
537 531
538static unsigned int __init intc_sense_data(struct intc_desc *desc, 532static unsigned int __init intc_sense_data(struct intc_desc *desc,
539 struct intc_desc_int *d, 533 struct intc_desc_int *d,
@@ -641,10 +635,8 @@ static void __init intc_register_irq(struct intc_desc *desc,
641 /* irq should be disabled by default */ 635 /* irq should be disabled by default */
642 d->chip.mask(irq); 636 d->chip.mask(irq);
643 637
644#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
645 if (desc->ack_regs) 638 if (desc->ack_regs)
646 ack_handle[irq] = intc_ack_data(desc, d, enum_id); 639 ack_handle[irq] = intc_ack_data(desc, d, enum_id);
647#endif
648} 640}
649 641
650static unsigned int __init save_reg(struct intc_desc_int *d, 642static unsigned int __init save_reg(struct intc_desc_int *d,
@@ -681,10 +673,8 @@ void __init register_intc_controller(struct intc_desc *desc)
681 d->nr_reg = desc->mask_regs ? desc->nr_mask_regs * 2 : 0; 673 d->nr_reg = desc->mask_regs ? desc->nr_mask_regs * 2 : 0;
682 d->nr_reg += desc->prio_regs ? desc->nr_prio_regs * 2 : 0; 674 d->nr_reg += desc->prio_regs ? desc->nr_prio_regs * 2 : 0;
683 d->nr_reg += desc->sense_regs ? desc->nr_sense_regs : 0; 675 d->nr_reg += desc->sense_regs ? desc->nr_sense_regs : 0;
684
685#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
686 d->nr_reg += desc->ack_regs ? desc->nr_ack_regs : 0; 676 d->nr_reg += desc->ack_regs ? desc->nr_ack_regs : 0;
687#endif 677
688 d->reg = kzalloc(d->nr_reg * sizeof(*d->reg), GFP_NOWAIT); 678 d->reg = kzalloc(d->nr_reg * sizeof(*d->reg), GFP_NOWAIT);
689#ifdef CONFIG_SMP 679#ifdef CONFIG_SMP
690 d->smp = kzalloc(d->nr_reg * sizeof(*d->smp), GFP_NOWAIT); 680 d->smp = kzalloc(d->nr_reg * sizeof(*d->smp), GFP_NOWAIT);
@@ -727,14 +717,12 @@ void __init register_intc_controller(struct intc_desc *desc)
727 d->chip.set_type = intc_set_sense; 717 d->chip.set_type = intc_set_sense;
728 d->chip.set_wake = intc_set_wake; 718 d->chip.set_wake = intc_set_wake;
729 719
730#if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A)
731 if (desc->ack_regs) { 720 if (desc->ack_regs) {
732 for (i = 0; i < desc->nr_ack_regs; i++) 721 for (i = 0; i < desc->nr_ack_regs; i++)
733 k += save_reg(d, k, desc->ack_regs[i].set_reg, 0); 722 k += save_reg(d, k, desc->ack_regs[i].set_reg, 0);
734 723
735 d->chip.mask_ack = intc_mask_ack; 724 d->chip.mask_ack = intc_mask_ack;
736 } 725 }
737#endif
738 726
739 BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ 727 BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */
740 728