summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-adnp.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2014-03-14 13:16:20 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-03-18 04:28:30 -0400
commit57ef04288abd27a717287a652d324f95cb77c3c6 (patch)
tree2cb5e15f0325e6860b008da5997e5f63d4cf6171 /drivers/gpio/gpio-adnp.c
parent1d4a2166f9501fd5b564b33414a2aa9c493fdfb8 (diff)
gpio: switch drivers to use new callback
This switches all GPIO and pin control drivers with irqchips that were using .startup() and .shutdown() callbacks to lock GPIO lines for IRQ usage over to using the .request_resources() and .release_resources() callbacks just introduced into the irqchip vtable. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jean-Jacques Hiblot <jjhiblot@traphandler.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-adnp.c')
-rw-r--r--drivers/gpio/gpio-adnp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index 6fc6206b38bd..b2239d678d01 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -408,24 +408,23 @@ static void adnp_irq_bus_unlock(struct irq_data *data)
408 mutex_unlock(&adnp->irq_lock); 408 mutex_unlock(&adnp->irq_lock);
409} 409}
410 410
411static unsigned int adnp_irq_startup(struct irq_data *data) 411static int adnp_irq_reqres(struct irq_data *data)
412{ 412{
413 struct adnp *adnp = irq_data_get_irq_chip_data(data); 413 struct adnp *adnp = irq_data_get_irq_chip_data(data);
414 414
415 if (gpio_lock_as_irq(&adnp->gpio, data->hwirq)) 415 if (gpio_lock_as_irq(&adnp->gpio, data->hwirq)) {
416 dev_err(adnp->gpio.dev, 416 dev_err(adnp->gpio.dev,
417 "unable to lock HW IRQ %lu for IRQ\n", 417 "unable to lock HW IRQ %lu for IRQ\n",
418 data->hwirq); 418 data->hwirq);
419 /* Satisfy the .enable semantics by unmasking the line */ 419 return -EINVAL;
420 adnp_irq_unmask(data); 420 }
421 return 0; 421 return 0;
422} 422}
423 423
424static void adnp_irq_shutdown(struct irq_data *data) 424static void adnp_irq_relres(struct irq_data *data)
425{ 425{
426 struct adnp *adnp = irq_data_get_irq_chip_data(data); 426 struct adnp *adnp = irq_data_get_irq_chip_data(data);
427 427
428 adnp_irq_mask(data);
429 gpio_unlock_as_irq(&adnp->gpio, data->hwirq); 428 gpio_unlock_as_irq(&adnp->gpio, data->hwirq);
430} 429}
431 430
@@ -436,8 +435,8 @@ static struct irq_chip adnp_irq_chip = {
436 .irq_set_type = adnp_irq_set_type, 435 .irq_set_type = adnp_irq_set_type,
437 .irq_bus_lock = adnp_irq_bus_lock, 436 .irq_bus_lock = adnp_irq_bus_lock,
438 .irq_bus_sync_unlock = adnp_irq_bus_unlock, 437 .irq_bus_sync_unlock = adnp_irq_bus_unlock,
439 .irq_startup = adnp_irq_startup, 438 .irq_request_resources = adnp_irq_reqres,
440 .irq_shutdown = adnp_irq_shutdown, 439 .irq_release_resources = adnp_irq_relres,
441}; 440};
442 441
443static int adnp_irq_map(struct irq_domain *domain, unsigned int irq, 442static int adnp_irq_map(struct irq_domain *domain, unsigned int irq,