aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-nomadik
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r--arch/arm/plat-nomadik/gpio.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index eda4e3a11a3d..1e88ecb846d1 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -356,13 +356,13 @@ static inline int nmk_gpio_get_bitmask(int gpio)
356 return 1 << (gpio % 32); 356 return 1 << (gpio % 32);
357} 357}
358 358
359static void nmk_gpio_irq_ack(unsigned int irq) 359static void nmk_gpio_irq_ack(struct irq_data *d)
360{ 360{
361 int gpio; 361 int gpio;
362 struct nmk_gpio_chip *nmk_chip; 362 struct nmk_gpio_chip *nmk_chip;
363 363
364 gpio = NOMADIK_IRQ_TO_GPIO(irq); 364 gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
365 nmk_chip = get_irq_chip_data(irq); 365 nmk_chip = irq_data_get_irq_chip_data(d);
366 if (!nmk_chip) 366 if (!nmk_chip)
367 return; 367 return;
368 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); 368 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
@@ -401,7 +401,7 @@ static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
401 } 401 }
402} 402}
403 403
404static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which, 404static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which,
405 bool enable) 405 bool enable)
406{ 406{
407 int gpio; 407 int gpio;
@@ -409,8 +409,8 @@ static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
409 unsigned long flags; 409 unsigned long flags;
410 u32 bitmask; 410 u32 bitmask;
411 411
412 gpio = NOMADIK_IRQ_TO_GPIO(irq); 412 gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
413 nmk_chip = get_irq_chip_data(irq); 413 nmk_chip = irq_data_get_irq_chip_data(d);
414 bitmask = nmk_gpio_get_bitmask(gpio); 414 bitmask = nmk_gpio_get_bitmask(gpio);
415 if (!nmk_chip) 415 if (!nmk_chip)
416 return -EINVAL; 416 return -EINVAL;
@@ -422,24 +422,24 @@ static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
422 return 0; 422 return 0;
423} 423}
424 424
425static void nmk_gpio_irq_mask(unsigned int irq) 425static void nmk_gpio_irq_mask(struct irq_data *d)
426{ 426{
427 nmk_gpio_irq_modify(irq, NORMAL, false); 427 nmk_gpio_irq_modify(d, NORMAL, false);
428} 428}
429 429
430static void nmk_gpio_irq_unmask(unsigned int irq) 430static void nmk_gpio_irq_unmask(struct irq_data *d)
431{ 431{
432 nmk_gpio_irq_modify(irq, NORMAL, true); 432 nmk_gpio_irq_modify(d, NORMAL, true);
433} 433}
434 434
435static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on) 435static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
436{ 436{
437 struct nmk_gpio_chip *nmk_chip; 437 struct nmk_gpio_chip *nmk_chip;
438 unsigned long flags; 438 unsigned long flags;
439 int gpio; 439 int gpio;
440 440
441 gpio = NOMADIK_IRQ_TO_GPIO(irq); 441 gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
442 nmk_chip = get_irq_chip_data(irq); 442 nmk_chip = irq_data_get_irq_chip_data(d);
443 if (!nmk_chip) 443 if (!nmk_chip)
444 return -EINVAL; 444 return -EINVAL;
445 445
@@ -457,9 +457,9 @@ static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on)
457 return 0; 457 return 0;
458} 458}
459 459
460static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) 460static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
461{ 461{
462 struct irq_desc *desc = irq_to_desc(irq); 462 struct irq_desc *desc = irq_to_desc(d->irq);
463 bool enabled = !(desc->status & IRQ_DISABLED); 463 bool enabled = !(desc->status & IRQ_DISABLED);
464 bool wake = desc->wake_depth; 464 bool wake = desc->wake_depth;
465 int gpio; 465 int gpio;
@@ -467,8 +467,8 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
467 unsigned long flags; 467 unsigned long flags;
468 u32 bitmask; 468 u32 bitmask;
469 469
470 gpio = NOMADIK_IRQ_TO_GPIO(irq); 470 gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
471 nmk_chip = get_irq_chip_data(irq); 471 nmk_chip = irq_data_get_irq_chip_data(d);
472 bitmask = nmk_gpio_get_bitmask(gpio); 472 bitmask = nmk_gpio_get_bitmask(gpio);
473 if (!nmk_chip) 473 if (!nmk_chip)
474 return -EINVAL; 474 return -EINVAL;
@@ -507,11 +507,11 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
507 507
508static struct irq_chip nmk_gpio_irq_chip = { 508static struct irq_chip nmk_gpio_irq_chip = {
509 .name = "Nomadik-GPIO", 509 .name = "Nomadik-GPIO",
510 .ack = nmk_gpio_irq_ack, 510 .irq_ack = nmk_gpio_irq_ack,
511 .mask = nmk_gpio_irq_mask, 511 .irq_mask = nmk_gpio_irq_mask,
512 .unmask = nmk_gpio_irq_unmask, 512 .irq_unmask = nmk_gpio_irq_unmask,
513 .set_type = nmk_gpio_irq_set_type, 513 .irq_set_type = nmk_gpio_irq_set_type,
514 .set_wake = nmk_gpio_irq_set_wake, 514 .irq_set_wake = nmk_gpio_irq_set_wake,
515}; 515};
516 516
517static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 517static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -522,12 +522,12 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
522 u32 pending; 522 u32 pending;
523 unsigned int first_irq; 523 unsigned int first_irq;
524 524
525 if (host_chip->mask_ack) 525 if (host_chip->irq_mask_ack)
526 host_chip->mask_ack(irq); 526 host_chip->irq_mask_ack(&desc->irq_data);
527 else { 527 else {
528 host_chip->mask(irq); 528 host_chip->irq_mask(&desc->irq_data);
529 if (host_chip->ack) 529 if (host_chip->irq_ack)
530 host_chip->ack(irq); 530 host_chip->irq_ack(&desc->irq_data);
531 } 531 }
532 532
533 nmk_chip = get_irq_data(irq); 533 nmk_chip = get_irq_data(irq);
@@ -537,7 +537,7 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
537 generic_handle_irq(gpio_irq); 537 generic_handle_irq(gpio_irq);
538 } 538 }
539 539
540 host_chip->unmask(irq); 540 host_chip->irq_unmask(&desc->irq_data);
541} 541}
542 542
543static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) 543static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)