aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx/media5200.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-03-08 17:26:47 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-09 19:03:57 -0500
commit8a2df7a0390ad7f02b10a66ede632bc9eee08876 (patch)
treec48391fe82de9f3da9188fb8a9f3df46014bf66a /arch/powerpc/platforms/52xx/media5200.c
parent0eb31577a755c3ed4c4182c2bf93c5618c60f13f (diff)
powerpc: platforms/52xx irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/52xx/media5200.c')
-rw-r--r--arch/powerpc/platforms/52xx/media5200.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c
index 2c7780cb68e5..2bd1e6cf1f58 100644
--- a/arch/powerpc/platforms/52xx/media5200.c
+++ b/arch/powerpc/platforms/52xx/media5200.c
@@ -49,45 +49,46 @@ struct media5200_irq {
49}; 49};
50struct media5200_irq media5200_irq; 50struct media5200_irq media5200_irq;
51 51
52static void media5200_irq_unmask(unsigned int virq) 52static void media5200_irq_unmask(struct irq_data *d)
53{ 53{
54 unsigned long flags; 54 unsigned long flags;
55 u32 val; 55 u32 val;
56 56
57 spin_lock_irqsave(&media5200_irq.lock, flags); 57 spin_lock_irqsave(&media5200_irq.lock, flags);
58 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE); 58 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE);
59 val |= 1 << (MEDIA5200_IRQ_SHIFT + irq_map[virq].hwirq); 59 val |= 1 << (MEDIA5200_IRQ_SHIFT + irq_map[d->irq].hwirq);
60 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val); 60 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val);
61 spin_unlock_irqrestore(&media5200_irq.lock, flags); 61 spin_unlock_irqrestore(&media5200_irq.lock, flags);
62} 62}
63 63
64static void media5200_irq_mask(unsigned int virq) 64static void media5200_irq_mask(struct irq_data *d)
65{ 65{
66 unsigned long flags; 66 unsigned long flags;
67 u32 val; 67 u32 val;
68 68
69 spin_lock_irqsave(&media5200_irq.lock, flags); 69 spin_lock_irqsave(&media5200_irq.lock, flags);
70 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE); 70 val = in_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE);
71 val &= ~(1 << (MEDIA5200_IRQ_SHIFT + irq_map[virq].hwirq)); 71 val &= ~(1 << (MEDIA5200_IRQ_SHIFT + irq_map[d->irq].hwirq));
72 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val); 72 out_be32(media5200_irq.regs + MEDIA5200_IRQ_ENABLE, val);
73 spin_unlock_irqrestore(&media5200_irq.lock, flags); 73 spin_unlock_irqrestore(&media5200_irq.lock, flags);
74} 74}
75 75
76static struct irq_chip media5200_irq_chip = { 76static struct irq_chip media5200_irq_chip = {
77 .name = "Media5200 FPGA", 77 .name = "Media5200 FPGA",
78 .unmask = media5200_irq_unmask, 78 .irq_unmask = media5200_irq_unmask,
79 .mask = media5200_irq_mask, 79 .irq_mask = media5200_irq_mask,
80 .mask_ack = media5200_irq_mask, 80 .irq_mask_ack = media5200_irq_mask,
81}; 81};
82 82
83void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc) 83void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
84{ 84{
85 struct irq_chip *chip = get_irq_desc_chip(desc);
85 int sub_virq, val; 86 int sub_virq, val;
86 u32 status, enable; 87 u32 status, enable;
87 88
88 /* Mask off the cascaded IRQ */ 89 /* Mask off the cascaded IRQ */
89 raw_spin_lock(&desc->lock); 90 raw_spin_lock(&desc->lock);
90 desc->chip->mask(virq); 91 chip->irq_mask(&desc->irq_data);
91 raw_spin_unlock(&desc->lock); 92 raw_spin_unlock(&desc->lock);
92 93
93 /* Ask the FPGA for IRQ status. If 'val' is 0, then no irqs 94 /* Ask the FPGA for IRQ status. If 'val' is 0, then no irqs
@@ -105,9 +106,9 @@ void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
105 106
106 /* Processing done; can reenable the cascade now */ 107 /* Processing done; can reenable the cascade now */
107 raw_spin_lock(&desc->lock); 108 raw_spin_lock(&desc->lock);
108 desc->chip->ack(virq); 109 chip->irq_ack(&desc->irq_data);
109 if (!(desc->status & IRQ_DISABLED)) 110 if (!(desc->status & IRQ_DISABLED))
110 desc->chip->unmask(virq); 111 chip->irq_unmask(&desc->irq_data);
111 raw_spin_unlock(&desc->lock); 112 raw_spin_unlock(&desc->lock);
112} 113}
113 114