aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/intc/core.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-10-27 02:42:10 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-10-27 02:42:10 -0400
commit26599a94dcadbed528a3e32a4f482a9766332f5b (patch)
tree11fff70fbef0971381399cd512beeaee74333a6e /drivers/sh/intc/core.c
parent815db1477a2ce44d248a4ff853a2bef3616c7478 (diff)
sh: intc: irq_data conversion.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh/intc/core.c')
-rw-r--r--drivers/sh/intc/core.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
index 0801089828e..338fad2a3fa 100644
--- a/drivers/sh/intc/core.c
+++ b/drivers/sh/intc/core.c
@@ -71,6 +71,7 @@ static void __init intc_register_irq(struct intc_desc *desc,
71 unsigned int irq) 71 unsigned int irq)
72{ 72{
73 struct intc_handle_int *hp; 73 struct intc_handle_int *hp;
74 struct irq_data *irq_data;
74 unsigned int data[2], primary; 75 unsigned int data[2], primary;
75 unsigned long flags; 76 unsigned long flags;
76 77
@@ -111,6 +112,8 @@ static void __init intc_register_irq(struct intc_desc *desc,
111 112
112 BUG_ON(!data[primary]); /* must have primary masking method */ 113 BUG_ON(!data[primary]); /* must have primary masking method */
113 114
115 irq_data = irq_get_irq_data(irq);
116
114 disable_irq_nosync(irq); 117 disable_irq_nosync(irq);
115 set_irq_chip_and_handler_name(irq, &d->chip, 118 set_irq_chip_and_handler_name(irq, &d->chip,
116 handle_level_irq, "level"); 119 handle_level_irq, "level");
@@ -123,7 +126,7 @@ static void __init intc_register_irq(struct intc_desc *desc,
123 126
124 /* enable secondary masking method if present */ 127 /* enable secondary masking method if present */
125 if (data[!primary]) 128 if (data[!primary])
126 _intc_enable(irq, data[!primary]); 129 _intc_enable(irq_data, data[!primary]);
127 130
128 /* add irq to d->prio list if priority is available */ 131 /* add irq to d->prio list if priority is available */
129 if (data[1]) { 132 if (data[1]) {
@@ -151,7 +154,7 @@ static void __init intc_register_irq(struct intc_desc *desc,
151 } 154 }
152 155
153 /* irq should be disabled by default */ 156 /* irq should be disabled by default */
154 d->chip.mask(irq); 157 d->chip.irq_mask(irq_data);
155 158
156 intc_set_ack_handle(irq, desc, d, enum_id); 159 intc_set_ack_handle(irq, desc, d, enum_id);
157 intc_set_dist_handle(irq, desc, d, enum_id); 160 intc_set_dist_handle(irq, desc, d, enum_id);
@@ -284,7 +287,7 @@ int __init register_intc_controller(struct intc_desc *desc)
284 for (i = 0; i < hw->nr_ack_regs; i++) 287 for (i = 0; i < hw->nr_ack_regs; i++)
285 k += save_reg(d, k, hw->ack_regs[i].set_reg, 0); 288 k += save_reg(d, k, hw->ack_regs[i].set_reg, 0);
286 else 289 else
287 d->chip.mask_ack = d->chip.disable; 290 d->chip.irq_mask_ack = d->chip.irq_disable;
288 291
289 /* disable bits matching force_disable before registering irqs */ 292 /* disable bits matching force_disable before registering irqs */
290 if (desc->force_disable) 293 if (desc->force_disable)
@@ -387,7 +390,9 @@ static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL);
387static int intc_suspend(struct sys_device *dev, pm_message_t state) 390static int intc_suspend(struct sys_device *dev, pm_message_t state)
388{ 391{
389 struct intc_desc_int *d; 392 struct intc_desc_int *d;
393 struct irq_data *data;
390 struct irq_desc *desc; 394 struct irq_desc *desc;
395 struct irq_chip *chip;
391 int irq; 396 int irq;
392 397
393 /* get intc controller associated with this sysdev */ 398 /* get intc controller associated with this sysdev */
@@ -398,17 +403,24 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state)
398 if (d->state.event != PM_EVENT_FREEZE) 403 if (d->state.event != PM_EVENT_FREEZE)
399 break; 404 break;
400 405
401 for_each_irq_desc(irq, desc) { 406 for_each_irq_nr(irq) {
407 desc = irq_to_desc(irq);
408 if (!desc)
409 continue;
410
411 data = irq_get_irq_data(irq);
412 chip = irq_data_get_irq_chip(data);
413
402 /* 414 /*
403 * This will catch the redirect and VIRQ cases 415 * This will catch the redirect and VIRQ cases
404 * due to the dummy_irq_chip being inserted. 416 * due to the dummy_irq_chip being inserted.
405 */ 417 */
406 if (desc->chip != &d->chip) 418 if (chip != &d->chip)
407 continue; 419 continue;
408 if (desc->status & IRQ_DISABLED) 420 if (desc->status & IRQ_DISABLED)
409 desc->chip->disable(irq); 421 chip->irq_disable(data);
410 else 422 else
411 desc->chip->enable(irq); 423 chip->irq_enable(data);
412 } 424 }
413 break; 425 break;
414 case PM_EVENT_FREEZE: 426 case PM_EVENT_FREEZE:
@@ -416,11 +428,18 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state)
416 break; 428 break;
417 case PM_EVENT_SUSPEND: 429 case PM_EVENT_SUSPEND:
418 /* enable wakeup irqs belonging to this intc controller */ 430 /* enable wakeup irqs belonging to this intc controller */
419 for_each_irq_desc(irq, desc) { 431 for_each_irq_nr(irq) {
420 if (desc->chip != &d->chip) 432 desc = irq_to_desc(irq);
433 if (!desc)
434 continue;
435
436 data = irq_get_irq_data(irq);
437 chip = irq_data_get_irq_chip(data);
438
439 if (chip != &d->chip)
421 continue; 440 continue;
422 if ((desc->status & IRQ_WAKEUP)) 441 if ((desc->status & IRQ_WAKEUP))
423 desc->chip->enable(irq); 442 chip->irq_enable(data);
424 } 443 }
425 break; 444 break;
426 } 445 }