aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-03-07 08:59:40 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-09 19:04:00 -0500
commitd8c94aca574b16b837db9441ee4643cd329b2036 (patch)
tree1062cd2e4381127916bc5252214f9dea06a8dfde
parent8f312ecf44ce585e64835b591e7c2b4e22352f17 (diff)
powerpc: platforms/powermac irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/powermac/pic.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 890d5f72b198..c55812bb6a51 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -82,9 +82,9 @@ static void __pmac_retrigger(unsigned int irq_nr)
82 } 82 }
83} 83}
84 84
85static void pmac_mask_and_ack_irq(unsigned int virq) 85static void pmac_mask_and_ack_irq(struct irq_data *d)
86{ 86{
87 unsigned int src = irq_map[virq].hwirq; 87 unsigned int src = irq_map[d->irq].hwirq;
88 unsigned long bit = 1UL << (src & 0x1f); 88 unsigned long bit = 1UL << (src & 0x1f);
89 int i = src >> 5; 89 int i = src >> 5;
90 unsigned long flags; 90 unsigned long flags;
@@ -104,9 +104,9 @@ static void pmac_mask_and_ack_irq(unsigned int virq)
104 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); 104 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
105} 105}
106 106
107static void pmac_ack_irq(unsigned int virq) 107static void pmac_ack_irq(struct irq_data *d)
108{ 108{
109 unsigned int src = irq_map[virq].hwirq; 109 unsigned int src = irq_map[d->irq].hwirq;
110 unsigned long bit = 1UL << (src & 0x1f); 110 unsigned long bit = 1UL << (src & 0x1f);
111 int i = src >> 5; 111 int i = src >> 5;
112 unsigned long flags; 112 unsigned long flags;
@@ -149,15 +149,15 @@ static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
149/* When an irq gets requested for the first client, if it's an 149/* When an irq gets requested for the first client, if it's an
150 * edge interrupt, we clear any previous one on the controller 150 * edge interrupt, we clear any previous one on the controller
151 */ 151 */
152static unsigned int pmac_startup_irq(unsigned int virq) 152static unsigned int pmac_startup_irq(struct irq_data *d)
153{ 153{
154 unsigned long flags; 154 unsigned long flags;
155 unsigned int src = irq_map[virq].hwirq; 155 unsigned int src = irq_map[d->irq].hwirq;
156 unsigned long bit = 1UL << (src & 0x1f); 156 unsigned long bit = 1UL << (src & 0x1f);
157 int i = src >> 5; 157 int i = src >> 5;
158 158
159 raw_spin_lock_irqsave(&pmac_pic_lock, flags); 159 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
160 if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0) 160 if ((irq_to_desc(d->irq)->status & IRQ_LEVEL) == 0)
161 out_le32(&pmac_irq_hw[i]->ack, bit); 161 out_le32(&pmac_irq_hw[i]->ack, bit);
162 __set_bit(src, ppc_cached_irq_mask); 162 __set_bit(src, ppc_cached_irq_mask);
163 __pmac_set_irq_mask(src, 0); 163 __pmac_set_irq_mask(src, 0);
@@ -166,10 +166,10 @@ static unsigned int pmac_startup_irq(unsigned int virq)
166 return 0; 166 return 0;
167} 167}
168 168
169static void pmac_mask_irq(unsigned int virq) 169static void pmac_mask_irq(struct irq_data *d)
170{ 170{
171 unsigned long flags; 171 unsigned long flags;
172 unsigned int src = irq_map[virq].hwirq; 172 unsigned int src = irq_map[d->irq].hwirq;
173 173
174 raw_spin_lock_irqsave(&pmac_pic_lock, flags); 174 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
175 __clear_bit(src, ppc_cached_irq_mask); 175 __clear_bit(src, ppc_cached_irq_mask);
@@ -177,10 +177,10 @@ static void pmac_mask_irq(unsigned int virq)
177 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); 177 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
178} 178}
179 179
180static void pmac_unmask_irq(unsigned int virq) 180static void pmac_unmask_irq(struct irq_data *d)
181{ 181{
182 unsigned long flags; 182 unsigned long flags;
183 unsigned int src = irq_map[virq].hwirq; 183 unsigned int src = irq_map[d->irq].hwirq;
184 184
185 raw_spin_lock_irqsave(&pmac_pic_lock, flags); 185 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
186 __set_bit(src, ppc_cached_irq_mask); 186 __set_bit(src, ppc_cached_irq_mask);
@@ -188,24 +188,24 @@ static void pmac_unmask_irq(unsigned int virq)
188 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); 188 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
189} 189}
190 190
191static int pmac_retrigger(unsigned int virq) 191static int pmac_retrigger(struct irq_data *d)
192{ 192{
193 unsigned long flags; 193 unsigned long flags;
194 194
195 raw_spin_lock_irqsave(&pmac_pic_lock, flags); 195 raw_spin_lock_irqsave(&pmac_pic_lock, flags);
196 __pmac_retrigger(irq_map[virq].hwirq); 196 __pmac_retrigger(irq_map[d->irq].hwirq);
197 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags); 197 raw_spin_unlock_irqrestore(&pmac_pic_lock, flags);
198 return 1; 198 return 1;
199} 199}
200 200
201static struct irq_chip pmac_pic = { 201static struct irq_chip pmac_pic = {
202 .name = "PMAC-PIC", 202 .name = "PMAC-PIC",
203 .startup = pmac_startup_irq, 203 .irq_startup = pmac_startup_irq,
204 .mask = pmac_mask_irq, 204 .irq_mask = pmac_mask_irq,
205 .ack = pmac_ack_irq, 205 .irq_ack = pmac_ack_irq,
206 .mask_ack = pmac_mask_and_ack_irq, 206 .irq_mask_ack = pmac_mask_and_ack_irq,
207 .unmask = pmac_unmask_irq, 207 .irq_unmask = pmac_unmask_irq,
208 .retrigger = pmac_retrigger, 208 .irq_retrigger = pmac_retrigger,
209}; 209};
210 210
211static irqreturn_t gatwick_action(int cpl, void *dev_id) 211static irqreturn_t gatwick_action(int cpl, void *dev_id)
@@ -472,12 +472,14 @@ int of_irq_map_oldworld(struct device_node *device, int index,
472 472
473static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc) 473static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc)
474{ 474{
475 struct mpic *mpic = desc->handler_data; 475 struct irq_chip *chip = get_irq_desc_chip(desc);
476 476 struct mpic *mpic = get_irq_desc_data(desc);
477 unsigned int cascade_irq = mpic_get_one_irq(mpic); 477 unsigned int cascade_irq = mpic_get_one_irq(mpic);
478
478 if (cascade_irq != NO_IRQ) 479 if (cascade_irq != NO_IRQ)
479 generic_handle_irq(cascade_irq); 480 generic_handle_irq(cascade_irq);
480 desc->chip->eoi(irq); 481
482 chip->irq_eoi(&desc->irq_data);
481} 483}
482 484
483static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) 485static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic)
@@ -707,7 +709,7 @@ static int pmacpic_resume(struct sys_device *sysdev)
707 mb(); 709 mb();
708 for (i = 0; i < max_real_irqs; ++i) 710 for (i = 0; i < max_real_irqs; ++i)
709 if (test_bit(i, sleep_save_mask)) 711 if (test_bit(i, sleep_save_mask))
710 pmac_unmask_irq(i); 712 pmac_unmask_irq(irq_get_irq_data(i));
711 713
712 return 0; 714 return 0;
713} 715}