mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Cc: Jean-Jacques Hiblot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
1d4a2166f9
commit
57ef04288a
13 changed files with 97 additions and 81 deletions
|
|
@ -324,6 +324,7 @@ static unsigned int adi_gpio_irq_startup(struct irq_data *d)
|
|||
|
||||
if (!port) {
|
||||
pr_err("GPIO IRQ %d :Not exist\n", d->irq);
|
||||
/* FIXME: negative return code will be ignored */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -371,23 +371,23 @@ static void byt_irq_mask(struct irq_data *d)
|
|||
{
|
||||
}
|
||||
|
||||
static unsigned int byt_irq_startup(struct irq_data *d)
|
||||
static int byt_irq_reqres(struct irq_data *d)
|
||||
{
|
||||
struct byt_gpio *vg = irq_data_get_irq_chip_data(d);
|
||||
|
||||
if (gpio_lock_as_irq(&vg->chip, irqd_to_hwirq(d)))
|
||||
if (gpio_lock_as_irq(&vg->chip, irqd_to_hwirq(d))) {
|
||||
dev_err(vg->chip.dev,
|
||||
"unable to lock HW IRQ %lu for IRQ\n",
|
||||
irqd_to_hwirq(d));
|
||||
byt_irq_unmask(d);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void byt_irq_shutdown(struct irq_data *d)
|
||||
static void byt_irq_relres(struct irq_data *d)
|
||||
{
|
||||
struct byt_gpio *vg = irq_data_get_irq_chip_data(d);
|
||||
|
||||
byt_irq_mask(d);
|
||||
gpio_unlock_as_irq(&vg->chip, irqd_to_hwirq(d));
|
||||
}
|
||||
|
||||
|
|
@ -396,8 +396,8 @@ static struct irq_chip byt_irqchip = {
|
|||
.irq_mask = byt_irq_mask,
|
||||
.irq_unmask = byt_irq_unmask,
|
||||
.irq_set_type = byt_irq_type,
|
||||
.irq_startup = byt_irq_startup,
|
||||
.irq_shutdown = byt_irq_shutdown,
|
||||
.irq_request_resources = byt_irq_reqres,
|
||||
.irq_release_resources = byt_irq_relres,
|
||||
};
|
||||
|
||||
static void byt_gpio_irq_init_hw(struct byt_gpio *vg)
|
||||
|
|
|
|||
|
|
@ -805,23 +805,22 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int msm_gpio_irq_startup(struct irq_data *d)
|
||||
static int msm_gpio_irq_reqres(struct irq_data *d)
|
||||
{
|
||||
struct msm_pinctrl *pctrl = irq_data_get_irq_chip_data(d);
|
||||
|
||||
if (gpio_lock_as_irq(&pctrl->chip, d->hwirq)) {
|
||||
dev_err(pctrl->dev, "unable to lock HW IRQ %lu for IRQ\n",
|
||||
d->hwirq);
|
||||
return -EINVAL;
|
||||
}
|
||||
msm_gpio_irq_unmask(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void msm_gpio_irq_shutdown(struct irq_data *d)
|
||||
static void msm_gpio_irq_relres(struct irq_data *d)
|
||||
{
|
||||
struct msm_pinctrl *pctrl = irq_data_get_irq_chip_data(d);
|
||||
|
||||
msm_gpio_irq_mask(d);
|
||||
gpio_unlock_as_irq(&pctrl->chip, d->hwirq);
|
||||
}
|
||||
|
||||
|
|
@ -832,8 +831,8 @@ static struct irq_chip msm_gpio_irq_chip = {
|
|||
.irq_ack = msm_gpio_irq_ack,
|
||||
.irq_set_type = msm_gpio_irq_set_type,
|
||||
.irq_set_wake = msm_gpio_irq_set_wake,
|
||||
.irq_startup = msm_gpio_irq_startup,
|
||||
.irq_shutdown = msm_gpio_irq_shutdown,
|
||||
.irq_request_resources = msm_gpio_irq_reqres,
|
||||
.irq_release_resources = msm_gpio_irq_relres,
|
||||
};
|
||||
|
||||
static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||
|
|
|
|||
|
|
@ -848,10 +848,6 @@ static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
|
|||
{
|
||||
struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
|
||||
|
||||
if (gpio_lock_as_irq(&nmk_chip->chip, d->hwirq))
|
||||
dev_err(nmk_chip->chip.dev,
|
||||
"unable to lock HW IRQ %lu for IRQ\n",
|
||||
d->hwirq);
|
||||
clk_enable(nmk_chip->clk);
|
||||
nmk_gpio_irq_unmask(d);
|
||||
return 0;
|
||||
|
|
@ -863,6 +859,25 @@ static void nmk_gpio_irq_shutdown(struct irq_data *d)
|
|||
|
||||
nmk_gpio_irq_mask(d);
|
||||
clk_disable(nmk_chip->clk);
|
||||
}
|
||||
|
||||
static int nmk_gpio_irq_reqres(struct irq_data *d)
|
||||
{
|
||||
struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
|
||||
|
||||
if (gpio_lock_as_irq(&nmk_chip->chip, d->hwirq)) {
|
||||
dev_err(nmk_chip->chip.dev,
|
||||
"unable to lock HW IRQ %lu for IRQ\n",
|
||||
d->hwirq);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void nmk_gpio_irq_relres(struct irq_data *d)
|
||||
{
|
||||
struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
|
||||
|
||||
gpio_unlock_as_irq(&nmk_chip->chip, d->hwirq);
|
||||
}
|
||||
|
||||
|
|
@ -875,6 +890,8 @@ static struct irq_chip nmk_gpio_irq_chip = {
|
|||
.irq_set_wake = nmk_gpio_irq_set_wake,
|
||||
.irq_startup = nmk_gpio_irq_startup,
|
||||
.irq_shutdown = nmk_gpio_irq_shutdown,
|
||||
.irq_request_resources = nmk_gpio_irq_reqres,
|
||||
.irq_release_resources = nmk_gpio_irq_relres,
|
||||
.flags = IRQCHIP_MASK_ON_SUSPEND,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -594,23 +594,23 @@ static int sirfsoc_gpio_irq_type(struct irq_data *d, unsigned type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int sirfsoc_gpio_irq_startup(struct irq_data *d)
|
||||
static int sirfsoc_gpio_irq_reqres(struct irq_data *d)
|
||||
{
|
||||
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
||||
|
||||
if (gpio_lock_as_irq(&bank->chip.gc, d->hwirq % SIRFSOC_GPIO_BANK_SIZE))
|
||||
if (gpio_lock_as_irq(&bank->chip.gc, d->hwirq % SIRFSOC_GPIO_BANK_SIZE)) {
|
||||
dev_err(bank->chip.gc.dev,
|
||||
"unable to lock HW IRQ %lu for IRQ\n",
|
||||
d->hwirq);
|
||||
sirfsoc_gpio_irq_unmask(d);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sirfsoc_gpio_irq_shutdown(struct irq_data *d)
|
||||
static void sirfsoc_gpio_irq_relres(struct irq_data *d)
|
||||
{
|
||||
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
|
||||
|
||||
sirfsoc_gpio_irq_mask(d);
|
||||
gpio_unlock_as_irq(&bank->chip.gc, d->hwirq % SIRFSOC_GPIO_BANK_SIZE);
|
||||
}
|
||||
|
||||
|
|
@ -620,8 +620,8 @@ static struct irq_chip sirfsoc_irq_chip = {
|
|||
.irq_mask = sirfsoc_gpio_irq_mask,
|
||||
.irq_unmask = sirfsoc_gpio_irq_unmask,
|
||||
.irq_set_type = sirfsoc_gpio_irq_type,
|
||||
.irq_startup = sirfsoc_gpio_irq_startup,
|
||||
.irq_shutdown = sirfsoc_gpio_irq_shutdown,
|
||||
.irq_request_resources = sirfsoc_gpio_irq_reqres,
|
||||
.irq_release_resources = sirfsoc_gpio_irq_relres,
|
||||
};
|
||||
|
||||
static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
|
||||
|
|
|
|||
Loading…
Reference in a new issue