mirror of
https://github.com/a52xq-dev/kernel.git
synced 2026-10-18 21:58:11 +07:00
gpio: Move irqdomain into struct gpio_irq_chip
In order to consolidate the multiple ways to associate an IRQ chip with a GPIO chip, move more fields into the new struct gpio_irq_chip. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
da80ff81a8
commit
f0fbe7bce7
56 changed files with 78 additions and 71 deletions
|
|
@ -254,7 +254,7 @@ GPIO irqchips usually fall in one of two categories:
|
|||
static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
|
||||
unsigned long wa_lock_flags;
|
||||
raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags);
|
||||
generic_handle_irq(irq_find_mapping(bank->chip.irqdomain, bit));
|
||||
generic_handle_irq(irq_find_mapping(bank->chip.irq.domain, bit));
|
||||
raw_spin_unlock_irqrestore(&bank->wa_lock, wa_lock_flags);
|
||||
|
||||
* GENERIC CHAINED GPIO irqchips: these are the same as "CHAINED GPIO irqchips",
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
|
|||
return IRQ_NONE;
|
||||
|
||||
for_each_set_bit(gpio, &irqs, gc->ngpio)
|
||||
generic_handle_irq(irq_find_mapping(gc->irqdomain, gpio));
|
||||
generic_handle_irq(irq_find_mapping(gc->irq.domain, gpio));
|
||||
bcma_chipco_gpio_polarity(cc, irqs, val & irqs);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ static irqreturn_t dio48e_irq_handler(int irq, void *dev_id)
|
|||
unsigned long gpio;
|
||||
|
||||
for_each_set_bit(gpio, &irq_mask, 2)
|
||||
generic_handle_irq(irq_find_mapping(chip->irqdomain,
|
||||
generic_handle_irq(irq_find_mapping(chip->irq.domain,
|
||||
19 + gpio*24));
|
||||
|
||||
raw_spin_lock(&dio48egpio->lock);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ static irqreturn_t idi_48_irq_handler(int irq, void *dev_id)
|
|||
for_each_set_bit(bit_num, &irq_mask, 8) {
|
||||
gpio = bit_num + boundary * 8;
|
||||
|
||||
generic_handle_irq(irq_find_mapping(chip->irqdomain,
|
||||
generic_handle_irq(irq_find_mapping(chip->irq.domain,
|
||||
gpio));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
|
|||
int gpio;
|
||||
|
||||
for_each_set_bit(gpio, &idio16gpio->irq_mask, chip->ngpio)
|
||||
generic_handle_irq(irq_find_mapping(chip->irqdomain, gpio));
|
||||
generic_handle_irq(irq_find_mapping(chip->irq.domain, gpio));
|
||||
|
||||
raw_spin_lock(&idio16gpio->lock);
|
||||
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ static irqreturn_t adnp_irq(int irq, void *data)
|
|||
|
||||
for_each_set_bit(bit, &pending, 8) {
|
||||
unsigned int child_irq;
|
||||
child_irq = irq_find_mapping(adnp->gpio.irqdomain,
|
||||
child_irq = irq_find_mapping(adnp->gpio.irq.domain,
|
||||
base + bit);
|
||||
handle_nested_irq(child_irq);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ static void altera_gpio_irq_edge_handler(struct irq_desc *desc)
|
|||
altera_gc = gpiochip_get_data(irq_desc_get_handler_data(desc));
|
||||
chip = irq_desc_get_chip(desc);
|
||||
mm_gc = &altera_gc->mmchip;
|
||||
irqdomain = altera_gc->mmchip.gc.irqdomain;
|
||||
irqdomain = altera_gc->mmchip.gc.irq.domain;
|
||||
|
||||
chained_irq_enter(chip, desc);
|
||||
|
||||
|
|
@ -239,7 +239,7 @@ static void altera_gpio_irq_leveL_high_handler(struct irq_desc *desc)
|
|||
altera_gc = gpiochip_get_data(irq_desc_get_handler_data(desc));
|
||||
chip = irq_desc_get_chip(desc);
|
||||
mm_gc = &altera_gc->mmchip;
|
||||
irqdomain = altera_gc->mmchip.gc.irqdomain;
|
||||
irqdomain = altera_gc->mmchip.gc.irq.domain;
|
||||
|
||||
chained_irq_enter(chip, desc);
|
||||
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ static void aspeed_gpio_irq_handler(struct irq_desc *desc)
|
|||
reg = ioread32(bank_irq_reg(data, bank, GPIO_IRQ_STATUS));
|
||||
|
||||
for_each_set_bit(p, ®, 32) {
|
||||
girq = irq_find_mapping(gc->irqdomain, i * 32 + p);
|
||||
girq = irq_find_mapping(gc->irq.domain, i * 32 + p);
|
||||
generic_handle_irq(girq);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ static void ath79_gpio_irq_handler(struct irq_desc *desc)
|
|||
if (pending) {
|
||||
for_each_set_bit(irq, &pending, gc->ngpio)
|
||||
generic_handle_irq(
|
||||
irq_linear_revmap(gc->irqdomain, irq));
|
||||
irq_linear_revmap(gc->irq.domain, irq));
|
||||
}
|
||||
|
||||
chained_irq_exit(irqchip, desc);
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
|
|||
|
||||
for (gpio = 0; gpio < CRYSTALCOVE_GPIO_NUM; gpio++) {
|
||||
if (pending & BIT(gpio)) {
|
||||
virq = irq_find_mapping(cg->chip.irqdomain, gpio);
|
||||
virq = irq_find_mapping(cg->chip.irq.domain, gpio);
|
||||
handle_nested_irq(virq);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
|
|||
return;
|
||||
}
|
||||
|
||||
irq = irq_find_mapping(dln2->gpio.irqdomain, pin);
|
||||
irq = irq_find_mapping(dln2->gpio.irq.domain, pin);
|
||||
if (!irq) {
|
||||
dev_err(dln2->gpio.parent, "pin %d not mapped to IRQ\n", pin);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ static void ftgpio_gpio_irq_handler(struct irq_desc *desc)
|
|||
stat = readl(g->base + GPIO_INT_STAT);
|
||||
if (stat)
|
||||
for_each_set_bit(offset, &stat, gc->ngpio)
|
||||
generic_handle_irq(irq_find_mapping(gc->irqdomain,
|
||||
generic_handle_irq(irq_find_mapping(gc->irq.domain,
|
||||
offset));
|
||||
|
||||
chained_irq_exit(irqchip, desc);
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ static void ingenic_gpio_irq_handler(struct irq_desc *desc)
|
|||
flag = gpio_ingenic_read_reg(jzgc, JZ4740_GPIO_FLAG);
|
||||
|
||||
for_each_set_bit(i, &flag, 32)
|
||||
generic_handle_irq(irq_linear_revmap(gc->irqdomain, i));
|
||||
generic_handle_irq(irq_linear_revmap(gc->irq.domain, i));
|
||||
chained_irq_exit(irq_chip, desc);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ static void intel_mid_irq_handler(struct irq_desc *desc)
|
|||
mask = BIT(gpio);
|
||||
/* Clear before handling so we can't lose an edge */
|
||||
writel(mask, gedr);
|
||||
generic_handle_irq(irq_find_mapping(gc->irqdomain,
|
||||
generic_handle_irq(irq_find_mapping(gc->irq.domain,
|
||||
base + gpio));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ static void lp_gpio_irq_handler(struct irq_desc *desc)
|
|||
mask = BIT(pin);
|
||||
/* Clear before handling so we don't lose an edge */
|
||||
outl(mask, reg);
|
||||
irq = irq_find_mapping(lg->chip.irqdomain, base + pin);
|
||||
irq = irq_find_mapping(lg->chip.irq.domain, base + pin);
|
||||
generic_handle_irq(irq);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ static irqreturn_t max732x_irq_handler(int irq, void *devid)
|
|||
|
||||
do {
|
||||
level = __ffs(pending);
|
||||
handle_nested_irq(irq_find_mapping(chip->gpio_chip.irqdomain,
|
||||
handle_nested_irq(irq_find_mapping(chip->gpio_chip.irq.domain,
|
||||
level));
|
||||
|
||||
pending &= ~(1 << level);
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ static void mrfld_irq_handler(struct irq_desc *desc)
|
|||
for_each_set_bit(gpio, &pending, 32) {
|
||||
unsigned int irq;
|
||||
|
||||
irq = irq_find_mapping(gc->irqdomain, base + gpio);
|
||||
irq = irq_find_mapping(gc->irq.domain, base + gpio);
|
||||
generic_handle_irq(irq);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
|
|||
|
||||
raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags);
|
||||
|
||||
generic_handle_irq(irq_find_mapping(bank->chip.irqdomain,
|
||||
generic_handle_irq(irq_find_mapping(bank->chip.irq.domain,
|
||||
bit));
|
||||
|
||||
raw_spin_unlock_irqrestore(&bank->wa_lock,
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
|
|||
for (i = 0; i < NBANK(chip); i++) {
|
||||
while (pending[i]) {
|
||||
level = __ffs(pending[i]);
|
||||
handle_nested_irq(irq_find_mapping(chip->gpio_chip.irqdomain,
|
||||
handle_nested_irq(irq_find_mapping(chip->gpio_chip.irq.domain,
|
||||
level + (BANK_SZ * i)));
|
||||
pending[i] &= ~(1 << level);
|
||||
nhandled++;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ static irqreturn_t pcf857x_irq(int irq, void *data)
|
|||
mutex_unlock(&gpio->lock);
|
||||
|
||||
for_each_set_bit(i, &change, gpio->chip.ngpio)
|
||||
handle_nested_irq(irq_find_mapping(gpio->chip.irqdomain, i));
|
||||
handle_nested_irq(irq_find_mapping(gpio->chip.irq.domain, i));
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue