aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/gpio.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-11-29 04:26:19 -0500
committerLennert Buytenhek <buytenh@wantstofly.org>2011-01-13 11:18:22 -0500
commitda0f9403d41e6cb210459571afddfce3646181ca (patch)
treee4233a61dd4122fc36518dbea0cc4e9d4f5ea10f /arch/arm/mach-at91/gpio.c
parent54502602c13dd2e7d1244942b9b3638ebe944760 (diff)
ARM: at91: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-at91/gpio.c')
-rw-r--r--arch/arm/mach-at91/gpio.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
index ae4772e744a..af818a21587 100644
--- a/arch/arm/mach-at91/gpio.c
+++ b/arch/arm/mach-at91/gpio.c
@@ -274,10 +274,10 @@ EXPORT_SYMBOL(at91_get_gpio_value);
274static u32 wakeups[MAX_GPIO_BANKS]; 274static u32 wakeups[MAX_GPIO_BANKS];
275static u32 backups[MAX_GPIO_BANKS]; 275static u32 backups[MAX_GPIO_BANKS];
276 276
277static int gpio_irq_set_wake(unsigned pin, unsigned state) 277static int gpio_irq_set_wake(struct irq_data *d, unsigned state)
278{ 278{
279 unsigned mask = pin_to_mask(pin); 279 unsigned mask = pin_to_mask(d->irq);
280 unsigned bank = (pin - PIN_BASE) / 32; 280 unsigned bank = (d->irq - PIN_BASE) / 32;
281 281
282 if (unlikely(bank >= MAX_GPIO_BANKS)) 282 if (unlikely(bank >= MAX_GPIO_BANKS))
283 return -EINVAL; 283 return -EINVAL;
@@ -344,25 +344,25 @@ void at91_gpio_resume(void)
344 * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. 344 * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering.
345 */ 345 */
346 346
347static void gpio_irq_mask(unsigned pin) 347static void gpio_irq_mask(struct irq_data *d)
348{ 348{
349 void __iomem *pio = pin_to_controller(pin); 349 void __iomem *pio = pin_to_controller(d->irq);
350 unsigned mask = pin_to_mask(pin); 350 unsigned mask = pin_to_mask(d->irq);
351 351
352 if (pio) 352 if (pio)
353 __raw_writel(mask, pio + PIO_IDR); 353 __raw_writel(mask, pio + PIO_IDR);
354} 354}
355 355
356static void gpio_irq_unmask(unsigned pin) 356static void gpio_irq_unmask(struct irq_data *d)
357{ 357{
358 void __iomem *pio = pin_to_controller(pin); 358 void __iomem *pio = pin_to_controller(d->irq);
359 unsigned mask = pin_to_mask(pin); 359 unsigned mask = pin_to_mask(d->irq);
360 360
361 if (pio) 361 if (pio)
362 __raw_writel(mask, pio + PIO_IER); 362 __raw_writel(mask, pio + PIO_IER);
363} 363}
364 364
365static int gpio_irq_type(unsigned pin, unsigned type) 365static int gpio_irq_type(struct irq_data *d, unsigned type)
366{ 366{
367 switch (type) { 367 switch (type) {
368 case IRQ_TYPE_NONE: 368 case IRQ_TYPE_NONE:
@@ -375,10 +375,10 @@ static int gpio_irq_type(unsigned pin, unsigned type)
375 375
376static struct irq_chip gpio_irqchip = { 376static struct irq_chip gpio_irqchip = {
377 .name = "GPIO", 377 .name = "GPIO",
378 .mask = gpio_irq_mask, 378 .irq_mask = gpio_irq_mask,
379 .unmask = gpio_irq_unmask, 379 .irq_unmask = gpio_irq_unmask,
380 .set_type = gpio_irq_type, 380 .irq_set_type = gpio_irq_type,
381 .set_wake = gpio_irq_set_wake, 381 .irq_set_wake = gpio_irq_set_wake,
382}; 382};
383 383
384static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) 384static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
@@ -393,7 +393,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
393 pio = at91_gpio->regbase; 393 pio = at91_gpio->regbase;
394 394
395 /* temporarily mask (level sensitive) parent IRQ */ 395 /* temporarily mask (level sensitive) parent IRQ */
396 desc->chip->ack(irq); 396 desc->irq_data.chip->irq_ack(&desc->irq_data);
397 for (;;) { 397 for (;;) {
398 /* Reading ISR acks pending (edge triggered) GPIO interrupts. 398 /* Reading ISR acks pending (edge triggered) GPIO interrupts.
399 * When there none are pending, we're finished unless we need 399 * When there none are pending, we're finished unless we need
@@ -419,7 +419,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
419 * another IRQ must be generated before it actually gets 419 * another IRQ must be generated before it actually gets
420 * here to be disabled on the GPIO controller. 420 * here to be disabled on the GPIO controller.
421 */ 421 */
422 gpio_irq_mask(pin); 422 gpio_irq_mask(irq_get_irq_data(pin));
423 } 423 }
424 else 424 else
425 generic_handle_irq(pin); 425 generic_handle_irq(pin);
@@ -429,7 +429,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
429 isr >>= 1; 429 isr >>= 1;
430 } 430 }
431 } 431 }
432 desc->chip->unmask(irq); 432 desc->irq_data.chip->irq_unmask(&desc->irq_data);
433 /* now it may re-trigger */ 433 /* now it may re-trigger */
434} 434}
435 435