aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-11-29 04:37:34 -0500
committerLennert Buytenhek <buytenh@wantstofly.org>2011-01-13 11:18:46 -0500
commit0f86ee082caa043d5e2990d42a1d5034d2a5caf6 (patch)
treebeaa78970123f6effffc05a8ef9b29be06842482
parenta157f26b2e624ce457a8f16b54d93f6af1850f85 (diff)
ARM: msm: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Acked-by: Gregory Bean <gbean@codeaurora.org> Acked-by: Daniel Walker <dwalker@codeaurora.org>
-rw-r--r--arch/arm/mach-msm/board-trout-gpio.c42
-rw-r--r--arch/arm/mach-msm/gpio.c48
-rw-r--r--arch/arm/mach-msm/irq-vic.c65
-rw-r--r--arch/arm/mach-msm/irq.c45
-rw-r--r--arch/arm/mach-msm/sirc.c39
5 files changed, 118 insertions, 121 deletions
diff --git a/arch/arm/mach-msm/board-trout-gpio.c b/arch/arm/mach-msm/board-trout-gpio.c
index f8c09ef6666f..a604ec1e44bf 100644
--- a/arch/arm/mach-msm/board-trout-gpio.c
+++ b/arch/arm/mach-msm/board-trout-gpio.c
@@ -113,52 +113,52 @@ static struct msm_gpio_chip msm_gpio_banks[] = {
113 TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0), 113 TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0),
114}; 114};
115 115
116static void trout_gpio_irq_ack(unsigned int irq) 116static void trout_gpio_irq_ack(struct irq_data *d)
117{ 117{
118 int bank = TROUT_INT_TO_BANK(irq); 118 int bank = TROUT_INT_TO_BANK(d->irq);
119 uint8_t mask = TROUT_INT_TO_MASK(irq); 119 uint8_t mask = TROUT_INT_TO_MASK(d->irq);
120 int reg = TROUT_BANK_TO_STAT_REG(bank); 120 int reg = TROUT_BANK_TO_STAT_REG(bank);
121 /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", irq);*/ 121 /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", d->irq);*/
122 writeb(mask, TROUT_CPLD_BASE + reg); 122 writeb(mask, TROUT_CPLD_BASE + reg);
123} 123}
124 124
125static void trout_gpio_irq_mask(unsigned int irq) 125static void trout_gpio_irq_mask(struct irq_data *d)
126{ 126{
127 unsigned long flags; 127 unsigned long flags;
128 uint8_t reg_val; 128 uint8_t reg_val;
129 int bank = TROUT_INT_TO_BANK(irq); 129 int bank = TROUT_INT_TO_BANK(d->irq);
130 uint8_t mask = TROUT_INT_TO_MASK(irq); 130 uint8_t mask = TROUT_INT_TO_MASK(d->irq);
131 int reg = TROUT_BANK_TO_MASK_REG(bank); 131 int reg = TROUT_BANK_TO_MASK_REG(bank);
132 132
133 local_irq_save(flags); 133 local_irq_save(flags);
134 reg_val = trout_int_mask[bank] |= mask; 134 reg_val = trout_int_mask[bank] |= mask;
135 /*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n", 135 /*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n",
136 irq, bank, reg_val);*/ 136 d->irq, bank, reg_val);*/
137 writeb(reg_val, TROUT_CPLD_BASE + reg); 137 writeb(reg_val, TROUT_CPLD_BASE + reg);
138 local_irq_restore(flags); 138 local_irq_restore(flags);
139} 139}
140 140
141static void trout_gpio_irq_unmask(unsigned int irq) 141static void trout_gpio_irq_unmask(struct irq_data *d)
142{ 142{
143 unsigned long flags; 143 unsigned long flags;
144 uint8_t reg_val; 144 uint8_t reg_val;
145 int bank = TROUT_INT_TO_BANK(irq); 145 int bank = TROUT_INT_TO_BANK(d->irq);
146 uint8_t mask = TROUT_INT_TO_MASK(irq); 146 uint8_t mask = TROUT_INT_TO_MASK(d->irq);
147 int reg = TROUT_BANK_TO_MASK_REG(bank); 147 int reg = TROUT_BANK_TO_MASK_REG(bank);
148 148
149 local_irq_save(flags); 149 local_irq_save(flags);
150 reg_val = trout_int_mask[bank] &= ~mask; 150 reg_val = trout_int_mask[bank] &= ~mask;
151 /*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n", 151 /*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n",
152 irq, bank, reg_val);*/ 152 d->irq, bank, reg_val);*/
153 writeb(reg_val, TROUT_CPLD_BASE + reg); 153 writeb(reg_val, TROUT_CPLD_BASE + reg);
154 local_irq_restore(flags); 154 local_irq_restore(flags);
155} 155}
156 156
157int trout_gpio_irq_set_wake(unsigned int irq, unsigned int on) 157int trout_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
158{ 158{
159 unsigned long flags; 159 unsigned long flags;
160 int bank = TROUT_INT_TO_BANK(irq); 160 int bank = TROUT_INT_TO_BANK(d->irq);
161 uint8_t mask = TROUT_INT_TO_MASK(irq); 161 uint8_t mask = TROUT_INT_TO_MASK(d->irq);
162 162
163 local_irq_save(flags); 163 local_irq_save(flags);
164 if(on) 164 if(on)
@@ -198,15 +198,15 @@ static void trout_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
198 } 198 }
199 int_base += TROUT_INT_BANK0_COUNT; 199 int_base += TROUT_INT_BANK0_COUNT;
200 } 200 }
201 desc->chip->ack(irq); 201 desc->irq_data.chip->irq_ack(&desc->irq_data);
202} 202}
203 203
204static struct irq_chip trout_gpio_irq_chip = { 204static struct irq_chip trout_gpio_irq_chip = {
205 .name = "troutgpio", 205 .name = "troutgpio",
206 .ack = trout_gpio_irq_ack, 206 .irq_ack = trout_gpio_irq_ack,
207 .mask = trout_gpio_irq_mask, 207 .irq_mask = trout_gpio_irq_mask,
208 .unmask = trout_gpio_irq_unmask, 208 .irq_unmask = trout_gpio_irq_unmask,
209 .set_wake = trout_gpio_irq_set_wake, 209 .irq_set_wake = trout_gpio_irq_set_wake,
210}; 210};
211 211
212/* 212/*
diff --git a/arch/arm/mach-msm/gpio.c b/arch/arm/mach-msm/gpio.c
index 33051b509e88..176af9dcb8ee 100644
--- a/arch/arm/mach-msm/gpio.c
+++ b/arch/arm/mach-msm/gpio.c
@@ -225,21 +225,21 @@ struct msm_gpio_chip msm_gpio_chips[] = {
225#endif 225#endif
226}; 226};
227 227
228static void msm_gpio_irq_ack(unsigned int irq) 228static void msm_gpio_irq_ack(struct irq_data *d)
229{ 229{
230 unsigned long irq_flags; 230 unsigned long irq_flags;
231 struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 231 struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
232 spin_lock_irqsave(&msm_chip->lock, irq_flags); 232 spin_lock_irqsave(&msm_chip->lock, irq_flags);
233 msm_gpio_clear_detect_status(msm_chip, 233 msm_gpio_clear_detect_status(msm_chip,
234 irq - gpio_to_irq(msm_chip->chip.base)); 234 d->irq - gpio_to_irq(msm_chip->chip.base));
235 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 235 spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
236} 236}
237 237
238static void msm_gpio_irq_mask(unsigned int irq) 238static void msm_gpio_irq_mask(struct irq_data *d)
239{ 239{
240 unsigned long irq_flags; 240 unsigned long irq_flags;
241 struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 241 struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
242 unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 242 unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
243 243
244 spin_lock_irqsave(&msm_chip->lock, irq_flags); 244 spin_lock_irqsave(&msm_chip->lock, irq_flags);
245 /* level triggered interrupts are also latched */ 245 /* level triggered interrupts are also latched */
@@ -250,11 +250,11 @@ static void msm_gpio_irq_mask(unsigned int irq)
250 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 250 spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
251} 251}
252 252
253static void msm_gpio_irq_unmask(unsigned int irq) 253static void msm_gpio_irq_unmask(struct irq_data *d)
254{ 254{
255 unsigned long irq_flags; 255 unsigned long irq_flags;
256 struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 256 struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
257 unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 257 unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
258 258
259 spin_lock_irqsave(&msm_chip->lock, irq_flags); 259 spin_lock_irqsave(&msm_chip->lock, irq_flags);
260 /* level triggered interrupts are also latched */ 260 /* level triggered interrupts are also latched */
@@ -265,11 +265,11 @@ static void msm_gpio_irq_unmask(unsigned int irq)
265 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 265 spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
266} 266}
267 267
268static int msm_gpio_irq_set_wake(unsigned int irq, unsigned int on) 268static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
269{ 269{
270 unsigned long irq_flags; 270 unsigned long irq_flags;
271 struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 271 struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
272 unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 272 unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
273 273
274 spin_lock_irqsave(&msm_chip->lock, irq_flags); 274 spin_lock_irqsave(&msm_chip->lock, irq_flags);
275 275
@@ -282,21 +282,21 @@ static int msm_gpio_irq_set_wake(unsigned int irq, unsigned int on)
282 return 0; 282 return 0;
283} 283}
284 284
285static int msm_gpio_irq_set_type(unsigned int irq, unsigned int flow_type) 285static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type)
286{ 286{
287 unsigned long irq_flags; 287 unsigned long irq_flags;
288 struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 288 struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
289 unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 289 unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
290 unsigned val, mask = BIT(offset); 290 unsigned val, mask = BIT(offset);
291 291
292 spin_lock_irqsave(&msm_chip->lock, irq_flags); 292 spin_lock_irqsave(&msm_chip->lock, irq_flags);
293 val = readl(msm_chip->regs.int_edge); 293 val = readl(msm_chip->regs.int_edge);
294 if (flow_type & IRQ_TYPE_EDGE_BOTH) { 294 if (flow_type & IRQ_TYPE_EDGE_BOTH) {
295 writel(val | mask, msm_chip->regs.int_edge); 295 writel(val | mask, msm_chip->regs.int_edge);
296 irq_desc[irq].handle_irq = handle_edge_irq; 296 irq_desc[d->irq].handle_irq = handle_edge_irq;
297 } else { 297 } else {
298 writel(val & ~mask, msm_chip->regs.int_edge); 298 writel(val & ~mask, msm_chip->regs.int_edge);
299 irq_desc[irq].handle_irq = handle_level_irq; 299 irq_desc[d->irq].handle_irq = handle_level_irq;
300 } 300 }
301 if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { 301 if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) {
302 msm_chip->both_edge_detect |= mask; 302 msm_chip->both_edge_detect |= mask;
@@ -333,16 +333,16 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
333 msm_chip->chip.base + j); 333 msm_chip->chip.base + j);
334 } 334 }
335 } 335 }
336 desc->chip->ack(irq); 336 desc->irq_data.chip->irq_ack(&desc->irq_data);
337} 337}
338 338
339static struct irq_chip msm_gpio_irq_chip = { 339static struct irq_chip msm_gpio_irq_chip = {
340 .name = "msmgpio", 340 .name = "msmgpio",
341 .ack = msm_gpio_irq_ack, 341 .irq_ack = msm_gpio_irq_ack,
342 .mask = msm_gpio_irq_mask, 342 .irq_mask = msm_gpio_irq_mask,
343 .unmask = msm_gpio_irq_unmask, 343 .irq_unmask = msm_gpio_irq_unmask,
344 .set_wake = msm_gpio_irq_set_wake, 344 .irq_set_wake = msm_gpio_irq_set_wake,
345 .set_type = msm_gpio_irq_set_type, 345 .irq_set_type = msm_gpio_irq_set_type,
346}; 346};
347 347
348static int __init msm_init_gpio(void) 348static int __init msm_init_gpio(void)
diff --git a/arch/arm/mach-msm/irq-vic.c b/arch/arm/mach-msm/irq-vic.c
index 99f2c3473033..68c28bbdc969 100644
--- a/arch/arm/mach-msm/irq-vic.c
+++ b/arch/arm/mach-msm/irq-vic.c
@@ -226,19 +226,18 @@ static inline void msm_irq_write_all_regs(void __iomem *base, unsigned int val)
226 writel(val, base + (i * 4)); 226 writel(val, base + (i * 4));
227} 227}
228 228
229static void msm_irq_ack(unsigned int irq) 229static void msm_irq_ack(struct irq_data *d)
230{ 230{
231 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, irq); 231 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq);
232 irq = 1 << (irq & 31); 232 writel(1 << (d->irq & 31), reg);
233 writel(irq, reg);
234} 233}
235 234
236static void msm_irq_mask(unsigned int irq) 235static void msm_irq_mask(struct irq_data *d)
237{ 236{
238 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, irq); 237 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, d->irq);
239 unsigned index = VIC_INT_TO_REG_INDEX(irq); 238 unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
240 uint32_t mask = 1UL << (irq & 31); 239 uint32_t mask = 1UL << (d->irq & 31);
241 int smsm_irq = msm_irq_to_smsm[irq]; 240 int smsm_irq = msm_irq_to_smsm[d->irq];
242 241
243 msm_irq_shadow_reg[index].int_en[0] &= ~mask; 242 msm_irq_shadow_reg[index].int_en[0] &= ~mask;
244 writel(mask, reg); 243 writel(mask, reg);
@@ -250,12 +249,12 @@ static void msm_irq_mask(unsigned int irq)
250 } 249 }
251} 250}
252 251
253static void msm_irq_unmask(unsigned int irq) 252static void msm_irq_unmask(struct irq_data *d)
254{ 253{
255 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, irq); 254 void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, d->irq);
256 unsigned index = VIC_INT_TO_REG_INDEX(irq); 255 unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
257 uint32_t mask = 1UL << (irq & 31); 256 uint32_t mask = 1UL << (d->irq & 31);
258 int smsm_irq = msm_irq_to_smsm[irq]; 257 int smsm_irq = msm_irq_to_smsm[d->irq];
259 258
260 msm_irq_shadow_reg[index].int_en[0] |= mask; 259 msm_irq_shadow_reg[index].int_en[0] |= mask;
261 writel(mask, reg); 260 writel(mask, reg);
@@ -268,14 +267,14 @@ static void msm_irq_unmask(unsigned int irq)
268 } 267 }
269} 268}
270 269
271static int msm_irq_set_wake(unsigned int irq, unsigned int on) 270static int msm_irq_set_wake(struct irq_data *d, unsigned int on)
272{ 271{
273 unsigned index = VIC_INT_TO_REG_INDEX(irq); 272 unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
274 uint32_t mask = 1UL << (irq & 31); 273 uint32_t mask = 1UL << (d->irq & 31);
275 int smsm_irq = msm_irq_to_smsm[irq]; 274 int smsm_irq = msm_irq_to_smsm[d->irq];
276 275
277 if (smsm_irq == 0) { 276 if (smsm_irq == 0) {
278 printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", irq); 277 printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", d->irq);
279 return -EINVAL; 278 return -EINVAL;
280 } 279 }
281 if (on) 280 if (on)
@@ -294,12 +293,12 @@ static int msm_irq_set_wake(unsigned int irq, unsigned int on)
294 return 0; 293 return 0;
295} 294}
296 295
297static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 296static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type)
298{ 297{
299 void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, irq); 298 void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, d->irq);
300 void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, irq); 299 void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, d->irq);
301 unsigned index = VIC_INT_TO_REG_INDEX(irq); 300 unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
302 int b = 1 << (irq & 31); 301 int b = 1 << (d->irq & 31);
303 uint32_t polarity; 302 uint32_t polarity;
304 uint32_t type; 303 uint32_t type;
305 304
@@ -314,11 +313,11 @@ static int msm_irq_set_type(unsigned int irq, unsigned int flow_type)
314 type = msm_irq_shadow_reg[index].int_type; 313 type = msm_irq_shadow_reg[index].int_type;
315 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 314 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
316 type |= b; 315 type |= b;
317 irq_desc[irq].handle_irq = handle_edge_irq; 316 irq_desc[d->irq].handle_irq = handle_edge_irq;
318 } 317 }
319 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 318 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
320 type &= ~b; 319 type &= ~b;
321 irq_desc[irq].handle_irq = handle_level_irq; 320 irq_desc[d->irq].handle_irq = handle_level_irq;
322 } 321 }
323 writel(type, treg); 322 writel(type, treg);
324 msm_irq_shadow_reg[index].int_type = type; 323 msm_irq_shadow_reg[index].int_type = type;
@@ -326,13 +325,13 @@ static int msm_irq_set_type(unsigned int irq, unsigned int flow_type)
326} 325}
327 326
328static struct irq_chip msm_irq_chip = { 327static struct irq_chip msm_irq_chip = {
329 .name = "msm", 328 .name = "msm",
330 .disable = msm_irq_mask, 329 .irq_disable = msm_irq_mask,
331 .ack = msm_irq_ack, 330 .irq_ack = msm_irq_ack,
332 .mask = msm_irq_mask, 331 .irq_mask = msm_irq_mask,
333 .unmask = msm_irq_unmask, 332 .irq_unmask = msm_irq_unmask,
334 .set_wake = msm_irq_set_wake, 333 .irq_set_wake = msm_irq_set_wake,
335 .set_type = msm_irq_set_type, 334 .irq_set_type = msm_irq_set_type,
336}; 335};
337 336
338void __init msm_init_irq(void) 337void __init msm_init_irq(void)
diff --git a/arch/arm/mach-msm/irq.c b/arch/arm/mach-msm/irq.c
index 6c8d5f8caef3..0b27d899f40e 100644
--- a/arch/arm/mach-msm/irq.c
+++ b/arch/arm/mach-msm/irq.c
@@ -64,35 +64,34 @@
64#define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4)) 64#define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4))
65#define VIC_VECTADDR(n) VIC_REG(0x0400+((n) * 4)) 65#define VIC_VECTADDR(n) VIC_REG(0x0400+((n) * 4))
66 66
67static void msm_irq_ack(unsigned int irq) 67static void msm_irq_ack(struct irq_data *d)
68{ 68{
69 void __iomem *reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0); 69 void __iomem *reg = VIC_INT_CLEAR0 + ((d->irq & 32) ? 4 : 0);
70 irq = 1 << (irq & 31); 70 writel(1 << (d->irq & 31), reg);
71 writel(irq, reg);
72} 71}
73 72
74static void msm_irq_mask(unsigned int irq) 73static void msm_irq_mask(struct irq_data *d)
75{ 74{
76 void __iomem *reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0); 75 void __iomem *reg = VIC_INT_ENCLEAR0 + ((d->irq & 32) ? 4 : 0);
77 writel(1 << (irq & 31), reg); 76 writel(1 << (d->irq & 31), reg);
78} 77}
79 78
80static void msm_irq_unmask(unsigned int irq) 79static void msm_irq_unmask(struct irq_data *d)
81{ 80{
82 void __iomem *reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0); 81 void __iomem *reg = VIC_INT_ENSET0 + ((d->irq & 32) ? 4 : 0);
83 writel(1 << (irq & 31), reg); 82 writel(1 << (d->irq & 31), reg);
84} 83}
85 84
86static int msm_irq_set_wake(unsigned int irq, unsigned int on) 85static int msm_irq_set_wake(struct irq_data *d, unsigned int on)
87{ 86{
88 return -EINVAL; 87 return -EINVAL;
89} 88}
90 89
91static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 90static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type)
92{ 91{
93 void __iomem *treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0); 92 void __iomem *treg = VIC_INT_TYPE0 + ((d->irq & 32) ? 4 : 0);
94 void __iomem *preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0); 93 void __iomem *preg = VIC_INT_POLARITY0 + ((d->irq & 32) ? 4 : 0);
95 int b = 1 << (irq & 31); 94 int b = 1 << (d->irq & 31);
96 95
97 if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) 96 if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
98 writel(readl(preg) | b, preg); 97 writel(readl(preg) | b, preg);
@@ -101,22 +100,22 @@ static int msm_irq_set_type(unsigned int irq, unsigned int flow_type)
101 100
102 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 101 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
103 writel(readl(treg) | b, treg); 102 writel(readl(treg) | b, treg);
104 irq_desc[irq].handle_irq = handle_edge_irq; 103 irq_desc[d->irq].handle_irq = handle_edge_irq;
105 } 104 }
106 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 105 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
107 writel(readl(treg) & (~b), treg); 106 writel(readl(treg) & (~b), treg);
108 irq_desc[irq].handle_irq = handle_level_irq; 107 irq_desc[d->irq].handle_irq = handle_level_irq;
109 } 108 }
110 return 0; 109 return 0;
111} 110}
112 111
113static struct irq_chip msm_irq_chip = { 112static struct irq_chip msm_irq_chip = {
114 .name = "msm", 113 .name = "msm",
115 .ack = msm_irq_ack, 114 .irq_ack = msm_irq_ack,
116 .mask = msm_irq_mask, 115 .irq_mask = msm_irq_mask,
117 .unmask = msm_irq_unmask, 116 .irq_unmask = msm_irq_unmask,
118 .set_wake = msm_irq_set_wake, 117 .irq_set_wake = msm_irq_set_wake,
119 .set_type = msm_irq_set_type, 118 .irq_set_type = msm_irq_set_type,
120}; 119};
121 120
122void __init msm_init_irq(void) 121void __init msm_init_irq(void)
diff --git a/arch/arm/mach-msm/sirc.c b/arch/arm/mach-msm/sirc.c
index 152eefda3ce6..11b54c7aeb09 100644
--- a/arch/arm/mach-msm/sirc.c
+++ b/arch/arm/mach-msm/sirc.c
@@ -42,12 +42,11 @@ static struct sirc_cascade_regs sirc_reg_table[] = {
42 42
43/* Mask off the given interrupt. Keep the int_enable mask in sync with 43/* Mask off the given interrupt. Keep the int_enable mask in sync with
44 the enable reg, so it can be restored after power collapse. */ 44 the enable reg, so it can be restored after power collapse. */
45static void sirc_irq_mask(unsigned int irq) 45static void sirc_irq_mask(struct irq_data *d)
46{ 46{
47 unsigned int mask; 47 unsigned int mask;
48 48
49 49 mask = 1 << (d->irq - FIRST_SIRC_IRQ);
50 mask = 1 << (irq - FIRST_SIRC_IRQ);
51 writel(mask, sirc_regs.int_enable_clear); 50 writel(mask, sirc_regs.int_enable_clear);
52 int_enable &= ~mask; 51 int_enable &= ~mask;
53 return; 52 return;
@@ -55,31 +54,31 @@ static void sirc_irq_mask(unsigned int irq)
55 54
56/* Unmask the given interrupt. Keep the int_enable mask in sync with 55/* Unmask the given interrupt. Keep the int_enable mask in sync with
57 the enable reg, so it can be restored after power collapse. */ 56 the enable reg, so it can be restored after power collapse. */
58static void sirc_irq_unmask(unsigned int irq) 57static void sirc_irq_unmask(struct irq_data *d)
59{ 58{
60 unsigned int mask; 59 unsigned int mask;
61 60
62 mask = 1 << (irq - FIRST_SIRC_IRQ); 61 mask = 1 << (d->irq - FIRST_SIRC_IRQ);
63 writel(mask, sirc_regs.int_enable_set); 62 writel(mask, sirc_regs.int_enable_set);
64 int_enable |= mask; 63 int_enable |= mask;
65 return; 64 return;
66} 65}
67 66
68static void sirc_irq_ack(unsigned int irq) 67static void sirc_irq_ack(struct irq_data *d)
69{ 68{
70 unsigned int mask; 69 unsigned int mask;
71 70
72 mask = 1 << (irq - FIRST_SIRC_IRQ); 71 mask = 1 << (d->irq - FIRST_SIRC_IRQ);
73 writel(mask, sirc_regs.int_clear); 72 writel(mask, sirc_regs.int_clear);
74 return; 73 return;
75} 74}
76 75
77static int sirc_irq_set_wake(unsigned int irq, unsigned int on) 76static int sirc_irq_set_wake(struct irq_data *d, unsigned int on)
78{ 77{
79 unsigned int mask; 78 unsigned int mask;
80 79
81 /* Used to set the interrupt enable mask during power collapse. */ 80 /* Used to set the interrupt enable mask during power collapse. */
82 mask = 1 << (irq - FIRST_SIRC_IRQ); 81 mask = 1 << (d->irq - FIRST_SIRC_IRQ);
83 if (on) 82 if (on)
84 wake_enable |= mask; 83 wake_enable |= mask;
85 else 84 else
@@ -88,12 +87,12 @@ static int sirc_irq_set_wake(unsigned int irq, unsigned int on)
88 return 0; 87 return 0;
89} 88}
90 89
91static int sirc_irq_set_type(unsigned int irq, unsigned int flow_type) 90static int sirc_irq_set_type(struct irq_data *d, unsigned int flow_type)
92{ 91{
93 unsigned int mask; 92 unsigned int mask;
94 unsigned int val; 93 unsigned int val;
95 94
96 mask = 1 << (irq - FIRST_SIRC_IRQ); 95 mask = 1 << (d->irq - FIRST_SIRC_IRQ);
97 val = readl(sirc_regs.int_polarity); 96 val = readl(sirc_regs.int_polarity);
98 97
99 if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING)) 98 if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING))
@@ -106,10 +105,10 @@ static int sirc_irq_set_type(unsigned int irq, unsigned int flow_type)
106 val = readl(sirc_regs.int_type); 105 val = readl(sirc_regs.int_type);
107 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 106 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
108 val |= mask; 107 val |= mask;
109 irq_desc[irq].handle_irq = handle_edge_irq; 108 irq_desc[d->irq].handle_irq = handle_edge_irq;
110 } else { 109 } else {
111 val &= ~mask; 110 val &= ~mask;
112 irq_desc[irq].handle_irq = handle_level_irq; 111 irq_desc[d->irq].handle_irq = handle_level_irq;
113 } 112 }
114 113
115 writel(val, sirc_regs.int_type); 114 writel(val, sirc_regs.int_type);
@@ -139,16 +138,16 @@ static void sirc_irq_handler(unsigned int irq, struct irq_desc *desc)
139 ; 138 ;
140 generic_handle_irq(sirq+FIRST_SIRC_IRQ); 139 generic_handle_irq(sirq+FIRST_SIRC_IRQ);
141 140
142 desc->chip->ack(irq); 141 desc->irq_data.chip->irq_ack(&desc->irq_data);
143} 142}
144 143
145static struct irq_chip sirc_irq_chip = { 144static struct irq_chip sirc_irq_chip = {
146 .name = "sirc", 145 .name = "sirc",
147 .ack = sirc_irq_ack, 146 .irq_ack = sirc_irq_ack,
148 .mask = sirc_irq_mask, 147 .irq_mask = sirc_irq_mask,
149 .unmask = sirc_irq_unmask, 148 .irq_unmask = sirc_irq_unmask,
150 .set_wake = sirc_irq_set_wake, 149 .irq_set_wake = sirc_irq_set_wake,
151 .set_type = sirc_irq_set_type, 150 .irq_set_type = sirc_irq_set_type,
152}; 151};
153 152
154void __init msm_init_sirc(void) 153void __init msm_init_sirc(void)