aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pinctrl/pinctrl-coh901.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c
index 162ac0d73739..749db595640c 100644
--- a/drivers/pinctrl/pinctrl-coh901.c
+++ b/drivers/pinctrl/pinctrl-coh901.c
@@ -529,10 +529,6 @@ static void u300_gpio_irq_enable(struct irq_data *d)
529 529
530 dev_dbg(gpio->dev, "enable IRQ for hwirq %lu on port %s, offset %d\n", 530 dev_dbg(gpio->dev, "enable IRQ for hwirq %lu on port %s, offset %d\n",
531 d->hwirq, port->name, offset); 531 d->hwirq, port->name, offset);
532 if (gpio_lock_as_irq(&gpio->chip, d->hwirq))
533 dev_err(gpio->dev,
534 "unable to lock HW IRQ %lu for IRQ\n",
535 d->hwirq);
536 local_irq_save(flags); 532 local_irq_save(flags);
537 val = readl(U300_PIN_REG(offset, ien)); 533 val = readl(U300_PIN_REG(offset, ien));
538 writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); 534 writel(val | U300_PIN_BIT(offset), U300_PIN_REG(offset, ien));
@@ -551,6 +547,27 @@ static void u300_gpio_irq_disable(struct irq_data *d)
551 val = readl(U300_PIN_REG(offset, ien)); 547 val = readl(U300_PIN_REG(offset, ien));
552 writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien)); 548 writel(val & ~U300_PIN_BIT(offset), U300_PIN_REG(offset, ien));
553 local_irq_restore(flags); 549 local_irq_restore(flags);
550}
551
552static int u300_gpio_irq_reqres(struct irq_data *d)
553{
554 struct u300_gpio_port *port = irq_data_get_irq_chip_data(d);
555 struct u300_gpio *gpio = port->gpio;
556
557 if (gpio_lock_as_irq(&gpio->chip, d->hwirq)) {
558 dev_err(gpio->dev,
559 "unable to lock HW IRQ %lu for IRQ\n",
560 d->hwirq);
561 return -EINVAL;
562 }
563 return 0;
564}
565
566static void u300_gpio_irq_relres(struct irq_data *d)
567{
568 struct u300_gpio_port *port = irq_data_get_irq_chip_data(d);
569 struct u300_gpio *gpio = port->gpio;
570
554 gpio_unlock_as_irq(&gpio->chip, d->hwirq); 571 gpio_unlock_as_irq(&gpio->chip, d->hwirq);
555} 572}
556 573
@@ -559,7 +576,8 @@ static struct irq_chip u300_gpio_irqchip = {
559 .irq_enable = u300_gpio_irq_enable, 576 .irq_enable = u300_gpio_irq_enable,
560 .irq_disable = u300_gpio_irq_disable, 577 .irq_disable = u300_gpio_irq_disable,
561 .irq_set_type = u300_gpio_irq_type, 578 .irq_set_type = u300_gpio_irq_type,
562 579 .irq_request_resources = u300_gpio_irq_reqres,
580 .irq_release_resources = u300_gpio_irq_relres,
563}; 581};
564 582
565static void u300_gpio_irq_handler(unsigned irq, struct irq_desc *desc) 583static void u300_gpio_irq_handler(unsigned irq, struct irq_desc *desc)