aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2011-03-08 17:27:02 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-09 19:04:03 -0500
commit42a07ae29a996b55e715a929786c12afc604d7c7 (patch)
treea5e76c12016516a4d94c348399e6da3168494080 /arch
parent11afe2bd8b8fd74dafe777eeb6d302d265b7b244 (diff)
powerpc: sysdev/uic irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/sysdev/uic.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 0038fb78f094..835f7958b237 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -55,11 +55,11 @@ struct uic {
55 struct irq_host *irqhost; 55 struct irq_host *irqhost;
56}; 56};
57 57
58static void uic_unmask_irq(unsigned int virq) 58static void uic_unmask_irq(struct irq_data *d)
59{ 59{
60 struct irq_desc *desc = irq_to_desc(virq); 60 struct irq_desc *desc = irq_to_desc(d->irq);
61 struct uic *uic = get_irq_chip_data(virq); 61 struct uic *uic = irq_data_get_irq_chip_data(d);
62 unsigned int src = uic_irq_to_hw(virq); 62 unsigned int src = uic_irq_to_hw(d->irq);
63 unsigned long flags; 63 unsigned long flags;
64 u32 er, sr; 64 u32 er, sr;
65 65
@@ -74,10 +74,10 @@ static void uic_unmask_irq(unsigned int virq)
74 spin_unlock_irqrestore(&uic->lock, flags); 74 spin_unlock_irqrestore(&uic->lock, flags);
75} 75}
76 76
77static void uic_mask_irq(unsigned int virq) 77static void uic_mask_irq(struct irq_data *d)
78{ 78{
79 struct uic *uic = get_irq_chip_data(virq); 79 struct uic *uic = irq_data_get_irq_chip_data(d);
80 unsigned int src = uic_irq_to_hw(virq); 80 unsigned int src = uic_irq_to_hw(d->irq);
81 unsigned long flags; 81 unsigned long flags;
82 u32 er; 82 u32 er;
83 83
@@ -88,10 +88,10 @@ static void uic_mask_irq(unsigned int virq)
88 spin_unlock_irqrestore(&uic->lock, flags); 88 spin_unlock_irqrestore(&uic->lock, flags);
89} 89}
90 90
91static void uic_ack_irq(unsigned int virq) 91static void uic_ack_irq(struct irq_data *d)
92{ 92{
93 struct uic *uic = get_irq_chip_data(virq); 93 struct uic *uic = irq_data_get_irq_chip_data(d);
94 unsigned int src = uic_irq_to_hw(virq); 94 unsigned int src = uic_irq_to_hw(d->irq);
95 unsigned long flags; 95 unsigned long flags;
96 96
97 spin_lock_irqsave(&uic->lock, flags); 97 spin_lock_irqsave(&uic->lock, flags);
@@ -99,11 +99,11 @@ static void uic_ack_irq(unsigned int virq)
99 spin_unlock_irqrestore(&uic->lock, flags); 99 spin_unlock_irqrestore(&uic->lock, flags);
100} 100}
101 101
102static void uic_mask_ack_irq(unsigned int virq) 102static void uic_mask_ack_irq(struct irq_data *d)
103{ 103{
104 struct irq_desc *desc = irq_to_desc(virq); 104 struct irq_desc *desc = irq_to_desc(d->irq);
105 struct uic *uic = get_irq_chip_data(virq); 105 struct uic *uic = irq_data_get_irq_chip_data(d);
106 unsigned int src = uic_irq_to_hw(virq); 106 unsigned int src = uic_irq_to_hw(d->irq);
107 unsigned long flags; 107 unsigned long flags;
108 u32 er, sr; 108 u32 er, sr;
109 109
@@ -125,18 +125,18 @@ static void uic_mask_ack_irq(unsigned int virq)
125 spin_unlock_irqrestore(&uic->lock, flags); 125 spin_unlock_irqrestore(&uic->lock, flags);
126} 126}
127 127
128static int uic_set_irq_type(unsigned int virq, unsigned int flow_type) 128static int uic_set_irq_type(struct irq_data *d, unsigned int flow_type)
129{ 129{
130 struct uic *uic = get_irq_chip_data(virq); 130 struct uic *uic = irq_data_get_irq_chip_data(d);
131 unsigned int src = uic_irq_to_hw(virq); 131 unsigned int src = uic_irq_to_hw(d->irq);
132 struct irq_desc *desc = irq_to_desc(virq); 132 struct irq_desc *desc = irq_to_desc(d->irq);
133 unsigned long flags; 133 unsigned long flags;
134 int trigger, polarity; 134 int trigger, polarity;
135 u32 tr, pr, mask; 135 u32 tr, pr, mask;
136 136
137 switch (flow_type & IRQ_TYPE_SENSE_MASK) { 137 switch (flow_type & IRQ_TYPE_SENSE_MASK) {
138 case IRQ_TYPE_NONE: 138 case IRQ_TYPE_NONE:
139 uic_mask_irq(virq); 139 uic_mask_irq(d);
140 return 0; 140 return 0;
141 141
142 case IRQ_TYPE_EDGE_RISING: 142 case IRQ_TYPE_EDGE_RISING:
@@ -178,11 +178,11 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
178 178
179static struct irq_chip uic_irq_chip = { 179static struct irq_chip uic_irq_chip = {
180 .name = "UIC", 180 .name = "UIC",
181 .unmask = uic_unmask_irq, 181 .irq_unmask = uic_unmask_irq,
182 .mask = uic_mask_irq, 182 .irq_mask = uic_mask_irq,
183 .mask_ack = uic_mask_ack_irq, 183 .irq_mask_ack = uic_mask_ack_irq,
184 .ack = uic_ack_irq, 184 .irq_ack = uic_ack_irq,
185 .set_type = uic_set_irq_type, 185 .irq_set_type = uic_set_irq_type,
186}; 186};
187 187
188static int uic_host_map(struct irq_host *h, unsigned int virq, 188static int uic_host_map(struct irq_host *h, unsigned int virq,
@@ -220,6 +220,7 @@ static struct irq_host_ops uic_host_ops = {
220 220
221void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) 221void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
222{ 222{
223 struct irq_chip *chip = get_irq_desc_chip(desc);
223 struct uic *uic = get_irq_data(virq); 224 struct uic *uic = get_irq_data(virq);
224 u32 msr; 225 u32 msr;
225 int src; 226 int src;
@@ -227,9 +228,9 @@ void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
227 228
228 raw_spin_lock(&desc->lock); 229 raw_spin_lock(&desc->lock);
229 if (desc->status & IRQ_LEVEL) 230 if (desc->status & IRQ_LEVEL)
230 desc->chip->mask(virq); 231 chip->irq_mask(&desc->irq_data);
231 else 232 else
232 desc->chip->mask_ack(virq); 233 chip->irq_mask_ack(&desc->irq_data);
233 raw_spin_unlock(&desc->lock); 234 raw_spin_unlock(&desc->lock);
234 235
235 msr = mfdcr(uic->dcrbase + UIC_MSR); 236 msr = mfdcr(uic->dcrbase + UIC_MSR);
@@ -244,9 +245,9 @@ void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
244uic_irq_ret: 245uic_irq_ret:
245 raw_spin_lock(&desc->lock); 246 raw_spin_lock(&desc->lock);
246 if (desc->status & IRQ_LEVEL) 247 if (desc->status & IRQ_LEVEL)
247 desc->chip->ack(virq); 248 chip->irq_ack(&desc->irq_data);
248 if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) 249 if (!(desc->status & IRQ_DISABLED) && chip->irq_unmask)
249 desc->chip->unmask(virq); 250 chip->irq_unmask(&desc->irq_data);
250 raw_spin_unlock(&desc->lock); 251 raw_spin_unlock(&desc->lock);
251} 252}
252 253