diff options
| -rw-r--r-- | arch/arm/plat-orion/gpio.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index b61a3bcc2fa8..e048f6198d68 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
| @@ -497,6 +497,34 @@ static void orion_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | |||
| 497 | #define orion_gpio_dbg_show NULL | 497 | #define orion_gpio_dbg_show NULL |
| 498 | #endif | 498 | #endif |
| 499 | 499 | ||
| 500 | static void orion_gpio_unmask_irq(struct irq_data *d) | ||
| 501 | { | ||
| 502 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
| 503 | struct irq_chip_type *ct = irq_data_get_chip_type(d); | ||
| 504 | u32 reg_val; | ||
| 505 | u32 mask = d->mask; | ||
| 506 | |||
| 507 | irq_gc_lock(gc); | ||
| 508 | reg_val = irq_reg_readl(gc->reg_base + ct->regs.mask); | ||
| 509 | reg_val |= mask; | ||
| 510 | irq_reg_writel(reg_val, gc->reg_base + ct->regs.mask); | ||
| 511 | irq_gc_unlock(gc); | ||
| 512 | } | ||
| 513 | |||
| 514 | static void orion_gpio_mask_irq(struct irq_data *d) | ||
| 515 | { | ||
| 516 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
| 517 | struct irq_chip_type *ct = irq_data_get_chip_type(d); | ||
| 518 | u32 mask = d->mask; | ||
| 519 | u32 reg_val; | ||
| 520 | |||
| 521 | irq_gc_lock(gc); | ||
| 522 | reg_val = irq_reg_readl(gc->reg_base + ct->regs.mask); | ||
| 523 | reg_val &= ~mask; | ||
| 524 | irq_reg_writel(reg_val, gc->reg_base + ct->regs.mask); | ||
| 525 | irq_gc_unlock(gc); | ||
| 526 | } | ||
| 527 | |||
| 500 | void __init orion_gpio_init(struct device_node *np, | 528 | void __init orion_gpio_init(struct device_node *np, |
| 501 | int gpio_base, int ngpio, | 529 | int gpio_base, int ngpio, |
| 502 | void __iomem *base, int mask_offset, | 530 | void __iomem *base, int mask_offset, |
| @@ -565,8 +593,8 @@ void __init orion_gpio_init(struct device_node *np, | |||
| 565 | ct = gc->chip_types; | 593 | ct = gc->chip_types; |
| 566 | ct->regs.mask = ochip->mask_offset + GPIO_LEVEL_MASK_OFF; | 594 | ct->regs.mask = ochip->mask_offset + GPIO_LEVEL_MASK_OFF; |
| 567 | ct->type = IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW; | 595 | ct->type = IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW; |
| 568 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | 596 | ct->chip.irq_mask = orion_gpio_mask_irq; |
| 569 | ct->chip.irq_unmask = irq_gc_mask_set_bit; | 597 | ct->chip.irq_unmask = orion_gpio_unmask_irq; |
| 570 | ct->chip.irq_set_type = gpio_irq_set_type; | 598 | ct->chip.irq_set_type = gpio_irq_set_type; |
| 571 | ct->chip.name = ochip->chip.label; | 599 | ct->chip.name = ochip->chip.label; |
| 572 | 600 | ||
| @@ -575,8 +603,8 @@ void __init orion_gpio_init(struct device_node *np, | |||
| 575 | ct->regs.ack = GPIO_EDGE_CAUSE_OFF; | 603 | ct->regs.ack = GPIO_EDGE_CAUSE_OFF; |
| 576 | ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; | 604 | ct->type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; |
| 577 | ct->chip.irq_ack = irq_gc_ack_clr_bit; | 605 | ct->chip.irq_ack = irq_gc_ack_clr_bit; |
| 578 | ct->chip.irq_mask = irq_gc_mask_clr_bit; | 606 | ct->chip.irq_mask = orion_gpio_mask_irq; |
| 579 | ct->chip.irq_unmask = irq_gc_mask_set_bit; | 607 | ct->chip.irq_unmask = orion_gpio_unmask_irq; |
| 580 | ct->chip.irq_set_type = gpio_irq_set_type; | 608 | ct->chip.irq_set_type = gpio_irq_set_type; |
| 581 | ct->handler = handle_edge_irq; | 609 | ct->handler = handle_edge_irq; |
| 582 | ct->chip.name = ochip->chip.label; | 610 | ct->chip.name = ochip->chip.label; |
