gpio: Move irqdomain into struct gpio_irq_chip
authorThierry Reding <treding@nvidia.com>
Tue, 7 Nov 2017 18:15:47 +0000 (19:15 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 8 Nov 2017 13:06:21 +0000 (14:06 +0100)
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>
56 files changed:
Documentation/gpio/driver.txt
drivers/bcma/driver_gpio.c
drivers/gpio/gpio-104-dio-48e.c
drivers/gpio/gpio-104-idi-48.c
drivers/gpio/gpio-104-idio-16.c
drivers/gpio/gpio-adnp.c
drivers/gpio/gpio-altera.c
drivers/gpio/gpio-aspeed.c
drivers/gpio/gpio-ath79.c
drivers/gpio/gpio-crystalcove.c
drivers/gpio/gpio-dln2.c
drivers/gpio/gpio-ftgpio010.c
drivers/gpio/gpio-ingenic.c
drivers/gpio/gpio-intel-mid.c
drivers/gpio/gpio-lynxpoint.c
drivers/gpio/gpio-max732x.c
drivers/gpio/gpio-merrifield.c
drivers/gpio/gpio-omap.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-pcf857x.c
drivers/gpio/gpio-pci-idio-16.c
drivers/gpio/gpio-pl061.c
drivers/gpio/gpio-rcar.c
drivers/gpio/gpio-reg.c
drivers/gpio/gpio-stmpe.c
drivers/gpio/gpio-tc3589x.c
drivers/gpio/gpio-vf610.c
drivers/gpio/gpio-wcove.c
drivers/gpio/gpio-ws16c48.c
drivers/gpio/gpio-xgene-sb.c
drivers/gpio/gpio-xlp.c
drivers/gpio/gpio-zx.c
drivers/gpio/gpio-zynq.c
drivers/gpio/gpiolib.c
drivers/pinctrl/bcm/pinctrl-bcm2835.c
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
drivers/pinctrl/intel/pinctrl-baytrail.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/pinctrl/intel/pinctrl-intel.c
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
drivers/pinctrl/nomadik/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-amd.c
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/pinctrl-coh901.c
drivers/pinctrl/pinctrl-mcp23s08.c
drivers/pinctrl/pinctrl-oxnas.c
drivers/pinctrl/pinctrl-pic32.c
drivers/pinctrl/pinctrl-pistachio.c
drivers/pinctrl/pinctrl-st.c
drivers/pinctrl/pinctrl-sx150x.c
drivers/pinctrl/qcom/pinctrl-msm.c
drivers/pinctrl/sirf/pinctrl-atlas7.c
drivers/pinctrl/sirf/pinctrl-sirf.c
drivers/pinctrl/spear/pinctrl-plgpio.c
drivers/platform/x86/intel_int0002_vgpio.c
include/linux/gpio/driver.h

index fc1d2f83564d9386594ddad44a7761ce3ca88ae1..dcf6af1d9e56ce4afda0442f734786d68c426a66 100644 (file)
@@ -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",
index 982d5781d3ce0c7dc513e4571923faf243cf1496..2c0ffb77d73899e501b4d6786cf7ad3014573ac6 100644 (file)
@@ -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;
index 598e209efa2de9d923d86a37b43958e0c1b5dcd3..bab3b94c5cbc1a6462080c4f53d1e38f7b8356a8 100644 (file)
@@ -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);
index 51f046e29ff79873c21497f1dfa8a5cd8cfdeb09..add859d59766006d45a5d5153cf805feea17e4fc 100644 (file)
@@ -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));
                }
        }
index ec2ce34ff47371d877385c48c9209dc3ce57f9dc..2f16638a05896631f7a133a3b8bddb667b328cc3 100644 (file)
@@ -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);
 
index 7f475eef3faa2066b8417d5cd926641318eca3f4..44c09904daa6adcbd261333986e4c09fbb627fc0 100644 (file)
@@ -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);
                }
index ccc02ed65b3c36371cbe6b292d99c28cbbb5840e..8e76d390e65388b57865b46daa535679033696d9 100644 (file)
@@ -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);
 
index 00dc1c020198579d4e931a97e994ea2cd10ff9c5..2bfce0ab732606cce71d757d951931ee3e3778b0 100644 (file)
@@ -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, &reg, 32) {
-                       girq = irq_find_mapping(gc->irqdomain, i * 32 + p);
+                       girq = irq_find_mapping(gc->irq.domain, i * 32 + p);
                        generic_handle_irq(girq);
                }
 
index 02e56e0c793ae985802172f2192b9f186fc6c526..5fad89dfab7ef57b8293930c5ae9fb0637a424a6 100644 (file)
@@ -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);
index e60156ec0c1842865bd7120c38ac85f58274fefd..b6f0f729656c2968a8d48906e85b31db7c03fbde 100644 (file)
@@ -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);
                }
        }
index aecb847166f537778d00ec7fe1df297b22d912eb..1dada68b9a27ab7b022cb309f7fb5ba9ac0b4f41 100644 (file)
@@ -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;
index e9386f8b67f568e3b6d9ff4b0376c86b0874c442..b7896bae83caa28a5d9b0b4b2de39570c47d5fe2 100644 (file)
@@ -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);
index 254780730b9570204b5985c260ae94e55bbf9bad..15fb2bc796a849889cd8213ccf9faf4196be361f 100644 (file)
@@ -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);
 }
 
index b76ecee82c3fd6b08fc9e0da65bc9a1eda5461d4..629575ea46a02f688dea05ebbcf153911b216a08 100644 (file)
@@ -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));
                }
        }
index fbd393b46ce03f5526b369de97f3efbc55dd2005..1e557b10d73ed3c66e8f6806994e144d19f257c2 100644 (file)
@@ -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);
                }
        }
index 7f4d26ce5f231a536e67d5d9991ded0be6d0ab55..c04fae1ba32a42d66d27f619bd616acb7862a9ab 100644 (file)
@@ -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);
index ec8560298805c8e6b7724b8c1dc97171e10ab39f..dd67a31ac33757e55da6cde7af6f2d8d7009cc1e 100644 (file)
@@ -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);
                }
        }
index dbf869fb63ced2cb2884be234c5275f2893237b2..ce27d6a586bf6f051e57bbf11fbadc9ffd608d6e 100644 (file)
@@ -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,
index 1b9dbf691ae7a88a55b6858e82f1e7a03c112e12..babb7bd2ba59b60aa723fa10606c186862a12af3 100644 (file)
@@ -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++;
index a4fd78b9c0e4e36a6c0e7bb2b1e80c97a999d2aa..38fbb420c6cd213325b0c2cdbf6795e100fabf30 100644 (file)
@@ -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;
 }
index 7de4f6a2cb494a47f81517fc46ac9fdbcc997ab2..57d1b7fbf07b6035ae20be08791acb1f7e6fd02e 100644 (file)
@@ -240,7 +240,7 @@ static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
                return IRQ_NONE;
 
        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);
 
index 6aaaab79c20579a9248c6a80a65e090ff2d692c8..b70974cb9ef178b5ca56b961ec0dc3e80d9eb5b5 100644 (file)
@@ -221,7 +221,7 @@ static void pl061_irq_handler(struct irq_desc *desc)
        pending = readb(pl061->base + GPIOMIS);
        if (pending) {
                for_each_set_bit(offset, &pending, PL061_GPIO_NR)
-                       generic_handle_irq(irq_find_mapping(gc->irqdomain,
+                       generic_handle_irq(irq_find_mapping(gc->irq.domain,
                                                            offset));
        }
 
index ddcff4f543bcd9a473dcf4203002b368e4995779..0ea998a3e357bf74a9e33ea54b5ba4e6759ebd09 100644 (file)
@@ -207,7 +207,7 @@ static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
                          gpio_rcar_read(p, INTMSK))) {
                offset = __ffs(pending);
                gpio_rcar_write(p, INTCLR, BIT(offset));
-               generic_handle_irq(irq_find_mapping(p->gpio_chip.irqdomain,
+               generic_handle_irq(irq_find_mapping(p->gpio_chip.irq.domain,
                                                    offset));
                irqs_handled++;
        }
index e85903eddc68ecd5930df5ded45efbc398aa57ca..23e771dba4c17ab7a497feb37c108f15fe117c79 100644 (file)
@@ -103,8 +103,8 @@ static int gpio_reg_to_irq(struct gpio_chip *gc, unsigned offset)
        struct gpio_reg *r = to_gpio_reg(gc);
        int irq = r->irqs[offset];
 
-       if (irq >= 0 && r->irqdomain)
-               irq = irq_find_mapping(r->irqdomain, irq);
+       if (irq >= 0 && r->irq.domain)
+               irq = irq_find_mapping(r->irq.domain, irq);
 
        return irq;
 }
index 001a89db516156a76dc787429c0b7c55d7aa99dc..18d8bef76d85f9aebe1b01ddafd778815958cbab 100644 (file)
@@ -397,7 +397,7 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
                while (stat) {
                        int bit = __ffs(stat);
                        int line = bank * 8 + bit;
-                       int child_irq = irq_find_mapping(stmpe_gpio->chip.irqdomain,
+                       int child_irq = irq_find_mapping(stmpe_gpio->chip.irq.domain,
                                                         line);
 
                        handle_nested_irq(child_irq);
index 433b45ef332e59b72a0ff34543d27a581f6d2940..91a8ef8e7f3fd18272d9ce5d071eeb640472236d 100644 (file)
@@ -268,7 +268,7 @@ static irqreturn_t tc3589x_gpio_irq(int irq, void *dev)
                while (stat) {
                        int bit = __ffs(stat);
                        int line = i * 8 + bit;
-                       int irq = irq_find_mapping(tc3589x_gpio->chip.irqdomain,
+                       int irq = irq_find_mapping(tc3589x_gpio->chip.irq.domain,
                                                   line);
 
                        handle_nested_irq(irq);
index cbe9e06861de0d490f592107de6704a651e2d644..4610cc2938ad01710250da1e52b992db43332fd4 100644 (file)
@@ -160,7 +160,7 @@ static void vf610_gpio_irq_handler(struct irq_desc *desc)
        for_each_set_bit(pin, &irq_isfr, VF610_GPIO_PER_PORT) {
                vf610_gpio_writel(BIT(pin), port->base + PORT_ISFR);
 
-               generic_handle_irq(irq_find_mapping(port->gc.irqdomain, pin));
+               generic_handle_irq(irq_find_mapping(port->gc.irq.domain, pin));
        }
 
        chained_irq_exit(chip, desc);
index 85341eab795d1b5078d46e0e942d1deda33ef758..dde7c6aecbb5e564e4975b9044abab785145013c 100644 (file)
@@ -350,7 +350,7 @@ static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
                        offset = (gpio > GROUP0_NR_IRQS) ? 1 : 0;
                        mask = (offset == 1) ? BIT(gpio - GROUP0_NR_IRQS) :
                                                                BIT(gpio);
-                       virq = irq_find_mapping(wg->chip.irqdomain, gpio);
+                       virq = irq_find_mapping(wg->chip.irq.domain, gpio);
                        handle_nested_irq(virq);
                        regmap_update_bits(wg->regmap, IRQ_STATUS_BASE + offset,
                                                                mask, mask);
index 5037974ac06356d0e4cba43f99923860f53b4706..746648244bf322aecf0ca5143a3ce47f739f723b 100644 (file)
@@ -332,7 +332,7 @@ static irqreturn_t ws16c48_irq_handler(int irq, void *dev_id)
                        int_id = inb(ws16c48gpio->base + 8 + port);
                        for_each_set_bit(gpio, &int_id, 8)
                                generic_handle_irq(irq_find_mapping(
-                                       chip->irqdomain, gpio + 8*port));
+                                       chip->irq.domain, gpio + 8*port));
                }
 
                int_pending = inb(ws16c48gpio->base + 6) & 0x7;
index 82c3ee6da66a60d302e86d0e48ab819ca62cabe4..4f2623c2393ebcd63ea7aa5868cff8ee55661b4e 100644 (file)
@@ -287,7 +287,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
        if (!priv->irq_domain)
                return -ENODEV;
 
-       priv->gc.irqdomain = priv->irq_domain;
+       priv->gc.irq.domain = priv->irq_domain;
 
        ret = devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
        if (ret) {
index d857e1d8e731e7f6e61023e38d960edc6c7c9e8c..e74bd43a69743af3d27f77eb7f419e6bc0b6e9a5 100644 (file)
@@ -225,7 +225,7 @@ static void xlp_gpio_generic_handler(struct irq_desc *desc)
 
                if (gpio_stat & BIT(gpio % XLP_GPIO_REGSZ))
                        generic_handle_irq(irq_find_mapping(
-                                               priv->chip.irqdomain, gpio));
+                                               priv->chip.irq.domain, gpio));
        }
        chained_irq_exit(irqchip, desc);
 }
index be3a87da8438016ff2f5ea800434ec9d8febeecb..5eacad9b2692111dc2e97b5a68a5f3ac8f86d68a 100644 (file)
@@ -170,7 +170,7 @@ static void zx_irq_handler(struct irq_desc *desc)
        writew_relaxed(pending, chip->base + ZX_GPIO_IC);
        if (pending) {
                for_each_set_bit(offset, &pending, ZX_GPIO_NR)
-                       generic_handle_irq(irq_find_mapping(gc->irqdomain,
+                       generic_handle_irq(irq_find_mapping(gc->irq.domain,
                                                            offset));
        }
 
index b3cc948a2d8b4e80af6c7b6d81c63e5eb8c78d10..75ee877e5cd5f53815c79d46fe6c69dba6599f3e 100644 (file)
@@ -562,7 +562,7 @@ static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio,
                                      unsigned long pending)
 {
        unsigned int bank_offset = gpio->p_data->bank_min[bank_num];
-       struct irq_domain *irqdomain = gpio->chip.irqdomain;
+       struct irq_domain *irqdomain = gpio->chip.irq.domain;
        int offset;
 
        if (!pending)
index d3d0b3134ba3be39b342e2a1f890701186523f27..9ee75a45ba37730bcdb9521f0ecb8859574c7cf5 100644 (file)
@@ -1550,7 +1550,7 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip,
 {
        unsigned int offset;
 
-       if (!gpiochip->irqdomain) {
+       if (!gpiochip->irq.domain) {
                chip_err(gpiochip, "called %s before setting up irqchip\n",
                         __func__);
                return;
@@ -1577,7 +1577,7 @@ static void gpiochip_set_cascaded_irqchip(struct gpio_chip *gpiochip,
        for (offset = 0; offset < gpiochip->ngpio; offset++) {
                if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
                        continue;
-               irq_set_parent(irq_find_mapping(gpiochip->irqdomain, offset),
+               irq_set_parent(irq_find_mapping(gpiochip->irq.domain, offset),
                               parent_irq);
        }
 }
@@ -1708,7 +1708,7 @@ static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
 {
        if (!gpiochip_irqchip_irq_valid(chip, offset))
                return -ENXIO;
-       return irq_create_mapping(chip->irqdomain, offset);
+       return irq_create_mapping(chip->irq.domain, offset);
 }
 
 /**
@@ -1719,7 +1719,7 @@ static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
  */
 static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
 {
-       unsigned int offset;
+       unsigned int offset, irq;
 
        acpi_gpiochip_free_interrupts(gpiochip);
 
@@ -1729,14 +1729,16 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
        }
 
        /* Remove all IRQ mappings and delete the domain */
-       if (gpiochip->irqdomain) {
+       if (gpiochip->irq.domain) {
                for (offset = 0; offset < gpiochip->ngpio; offset++) {
                        if (!gpiochip_irqchip_irq_valid(gpiochip, offset))
                                continue;
-                       irq_dispose_mapping(
-                               irq_find_mapping(gpiochip->irqdomain, offset));
+
+                       irq = irq_find_mapping(gpiochip->irq.domain, offset);
+                       irq_dispose_mapping(irq);
                }
-               irq_domain_remove(gpiochip->irqdomain);
+
+               irq_domain_remove(gpiochip->irq.domain);
        }
 
        if (gpiochip->irq.chip) {
@@ -1822,10 +1824,10 @@ int gpiochip_irqchip_add_key(struct gpio_chip *gpiochip,
        gpiochip->irq_default_type = type;
        gpiochip->to_irq = gpiochip_to_irq;
        gpiochip->lock_key = lock_key;
-       gpiochip->irqdomain = irq_domain_add_simple(of_node,
+       gpiochip->irq.domain = irq_domain_add_simple(of_node,
                                        gpiochip->ngpio, first_irq,
                                        &gpiochip_domain_ops, gpiochip);
-       if (!gpiochip->irqdomain) {
+       if (!gpiochip->irq.domain) {
                gpiochip->irq.chip = NULL;
                return -EINVAL;
        }
index 0944310225db92a8ee2c5011c7fb394044ccfd22..fb85ab3cf6628ffed8df8b66e7c3c3f374aa0305 100644 (file)
@@ -383,7 +383,7 @@ static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
                /* FIXME: no clue why the code looks up the type here */
                type = pc->irq_type[gpio];
 
-               generic_handle_irq(irq_linear_revmap(pc->gpio_chip.irqdomain,
+               generic_handle_irq(irq_linear_revmap(pc->gpio_chip.irq.irqdomain,
                                                     gpio));
        }
 }
@@ -665,7 +665,7 @@ static void bcm2835_pctl_pin_dbg_show(struct pinctrl_dev *pctldev,
        enum bcm2835_fsel fsel = bcm2835_pinctrl_fsel_get(pc, offset);
        const char *fname = bcm2835_functions[fsel];
        int value = bcm2835_gpio_get_bit(pc, GPLEV0, offset);
-       int irq = irq_find_mapping(chip->irqdomain, offset);
+       int irq = irq_find_mapping(chip->irq.domain, offset);
 
        seq_printf(s, "function %s in %s; irq %d (%s)",
                fname, value ? "hi" : "lo",
index 85a8c97d9dfed2bfa0a9674596ea2a2bfbd15c93..b93f62dc87333f242489e591cb721eac7fe8a011 100644 (file)
@@ -172,7 +172,7 @@ static void iproc_gpio_irq_handler(struct irq_desc *desc)
 
                for_each_set_bit(bit, &val, NGPIOS_PER_BANK) {
                        unsigned pin = NGPIOS_PER_BANK * i + bit;
-                       int child_irq = irq_find_mapping(gc->irqdomain, pin);
+                       int child_irq = irq_find_mapping(gc->irq.domain, pin);
 
                        /*
                         * Clear the interrupt before invoking the
index 0f3a02495aeb66aae84c31bab5d40278825946f7..5897981e5ed3b6ef62ff5d1e601f94b7f2ad8e0d 100644 (file)
@@ -1627,7 +1627,7 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
                pending = readl(reg);
                raw_spin_unlock(&vg->lock);
                for_each_set_bit(pin, &pending, 32) {
-                       virq = irq_find_mapping(vg->chip.irqdomain, base + pin);
+                       virq = irq_find_mapping(vg->chip.irq.domain, base + pin);
                        generic_handle_irq(virq);
                }
        }
index 04e929fd0ffee494cc744cf495e5acd9e437ea6b..1cd7043edbc15e7068a57fec217d331764efbd1c 100644 (file)
@@ -1523,7 +1523,7 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
                unsigned irq, offset;
 
                offset = pctrl->intr_lines[intr_line];
-               irq = irq_find_mapping(gc->irqdomain, offset);
+               irq = irq_find_mapping(gc->irq.domain, offset);
                generic_handle_irq(irq);
        }
 
index 71df0f70b61f01c51484c87f35bdba9a1158cdbc..ffda27bfd133c79fcf0f0d25ab8af46a00336032 100644 (file)
@@ -1005,7 +1005,7 @@ static irqreturn_t intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl,
                        if (padno >= community->npins)
                                break;
 
-                       irq = irq_find_mapping(gc->irqdomain,
+                       irq = irq_find_mapping(gc->irq.domain,
                                               community->pin_base + padno);
                        generic_handle_irq(irq);
 
index e800d55c340b0b956ba6d24c5a5ee4c9d1f1145b..d754a9b10e19de2b82e8cce78117e19d88827c95 100644 (file)
@@ -592,7 +592,7 @@ static void armada_37xx_irq_handler(struct irq_desc *desc)
        struct gpio_chip *gc = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct armada_37xx_pinctrl *info = gpiochip_get_data(gc);
-       struct irq_domain *d = gc->irqdomain;
+       struct irq_domain *d = gc->irq.domain;
        int i;
 
        chained_irq_enter(chip, desc);
index a53f1a9b1ed21f2599b9531cef403a44fb85f7af..f0e7a8c114b229b87948927a68642f829575167b 100644 (file)
@@ -413,7 +413,7 @@ nmk_gpio_disable_lazy_irq(struct nmk_gpio_chip *nmk_chip, unsigned offset)
        u32 falling = nmk_chip->fimsc & BIT(offset);
        u32 rising = nmk_chip->rimsc & BIT(offset);
        int gpio = nmk_chip->chip.base + offset;
-       int irq = irq_find_mapping(nmk_chip->chip.irqdomain, offset);
+       int irq = irq_find_mapping(nmk_chip->chip.irq.domain, offset);
        struct irq_data *d = irq_get_irq_data(irq);
 
        if (!rising && !falling)
@@ -815,7 +815,7 @@ static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status)
        while (status) {
                int bit = __ffs(status);
 
-               generic_handle_irq(irq_find_mapping(chip->irqdomain, bit));
+               generic_handle_irq(irq_find_mapping(chip->irq.domain, bit));
                status &= ~BIT(bit);
        }
 
index 3f6b34febbf11249cf2a30e400647038f4a66f33..06362bf84a5bf23b549052f1f961e79423e3e727 100644 (file)
@@ -532,7 +532,7 @@ static irqreturn_t amd_gpio_irq_handler(int irq, void *dev_id)
                        regval = readl(regs + i);
                        if (!(regval & PIN_IRQ_PENDING))
                                continue;
-                       irq = irq_find_mapping(gc->irqdomain, irqnr + i);
+                       irq = irq_find_mapping(gc->irq.domain, irqnr + i);
                        generic_handle_irq(irq);
                        /* Clear interrupt */
                        writel(regval, regs + i);
index 569bc28cb90972943bb0929127688b2a1e59ff91..03492e3c09fa3ff0885cb357fdbdf80c68485724 100644 (file)
@@ -1603,7 +1603,7 @@ static void gpio_irq_handler(struct irq_desc *desc)
 
                for_each_set_bit(n, &isr, BITS_PER_LONG) {
                        generic_handle_irq(irq_find_mapping(
-                                          gpio_chip->irqdomain, n));
+                                          gpio_chip->irq.domain, n));
                }
        }
        chained_irq_exit(chip, desc);
index ac155e7d34129149f847bcb17bb8cbf0aa64690c..7939b178c6ae7bb73d53cf0bac9bed2826979d01 100644 (file)
@@ -517,7 +517,7 @@ static void u300_gpio_irq_handler(struct irq_desc *desc)
 
                for_each_set_bit(irqoffset, &val, U300_GPIO_PINS_PER_PORT) {
                        int offset = pinoffset + irqoffset;
-                       int pin_irq = irq_find_mapping(chip->irqdomain, offset);
+                       int pin_irq = irq_find_mapping(chip->irq.domain, offset);
 
                        dev_dbg(gpio->dev, "GPIO IRQ %d on pin %d\n",
                                pin_irq, offset);
index 3e40d4245512e286166ac1b838567f6c55a881a0..db19a2f2f57576f06a5a7182d95a8b4d8f189a9b 100644 (file)
@@ -537,7 +537,7 @@ static irqreturn_t mcp23s08_irq(int irq, void *data)
                    ((gpio_bit_changed || intcap_changed) &&
                        (BIT(i) & mcp->irq_fall) && !gpio_set) ||
                    defval_changed) {
-                       child_irq = irq_find_mapping(mcp->chip.irqdomain, i);
+                       child_irq = irq_find_mapping(mcp->chip.irq.domain, i);
                        handle_nested_irq(child_irq);
                }
        }
index 494ec9a7573a5c2026386d7753e503d53fada9ab..53ec22a51f5c937c08f1803d27e2201af446043b 100644 (file)
@@ -1064,7 +1064,7 @@ static void oxnas_gpio_irq_handler(struct irq_desc *desc)
        stat = readl(bank->reg_base + IRQ_PENDING);
 
        for_each_set_bit(pin, &stat, BITS_PER_LONG)
-               generic_handle_irq(irq_linear_revmap(gc->irqdomain, pin));
+               generic_handle_irq(irq_linear_revmap(gc->irq.domain, pin));
 
        chained_irq_exit(chip, desc);
 }
index 31ceb958b3febf5e2b61b991f8af6d6245a70189..96390228d388c5fb730b84a8f0eae394751a9941 100644 (file)
@@ -2106,7 +2106,7 @@ static void pic32_gpio_irq_handler(struct irq_desc *desc)
        pending = pic32_gpio_get_pending(gc, stat);
 
        for_each_set_bit(pin, &pending, BITS_PER_LONG)
-               generic_handle_irq(irq_linear_revmap(gc->irqdomain, pin));
+               generic_handle_irq(irq_linear_revmap(gc->irq.domain, pin));
 
        chained_irq_exit(chip, desc);
 }
index 55375b1b3cc81b20cf6fc83722c89cfaa9ecefc2..302190d1558d98e2124b48aa35e7ce714ae2a559 100644 (file)
@@ -1307,7 +1307,7 @@ static void pistachio_gpio_irq_handler(struct irq_desc *desc)
        pending = gpio_readl(bank, GPIO_INTERRUPT_STATUS) &
                gpio_readl(bank, GPIO_INTERRUPT_EN);
        for_each_set_bit(pin, &pending, 16)
-               generic_handle_irq(irq_linear_revmap(gc->irqdomain, pin));
+               generic_handle_irq(irq_linear_revmap(gc->irq.domain, pin));
        chained_irq_exit(chip, desc);
 }
 
index a5205b94b2e61e18d1b2064a815d90e70536ffc6..2081c67667a88b3a7927e4c3e4bc7a753787f043 100644 (file)
@@ -1408,7 +1408,7 @@ static void __gpio_irq_handler(struct st_gpio_bank *bank)
                                        continue;
                        }
 
-                       generic_handle_irq(irq_find_mapping(bank->gpio_chip.irqdomain, n));
+                       generic_handle_irq(irq_find_mapping(bank->gpio_chip.irq.domain, n));
                }
        }
 }
index 7450f511844569d32b0bda6cefa3423a1cbb5eba..7db4f6a6eb171f833653dd1735f01973840418fe 100644 (file)
@@ -561,7 +561,7 @@ static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id)
 
        status = val;
        for_each_set_bit(n, &status, pctl->data->ngpios)
-               handle_nested_irq(irq_find_mapping(pctl->gpio.irqdomain, n));
+               handle_nested_irq(irq_find_mapping(pctl->gpio.irq.domain, n));
 
        return IRQ_HANDLED;
 }
index ff491da64dab8420298c9e00d22eddac908b310c..7a960590ecaae8a602af8baab88b200dc56ecd57 100644 (file)
@@ -795,7 +795,7 @@ static void msm_gpio_irq_handler(struct irq_desc *desc)
                g = &pctrl->soc->groups[i];
                val = readl(pctrl->regs + g->intr_status_reg);
                if (val & BIT(g->intr_status_bit)) {
-                       irq_pin = irq_find_mapping(gc->irqdomain, i);
+                       irq_pin = irq_find_mapping(gc->irq.domain, i);
                        generic_handle_irq(irq_pin);
                        handled++;
                }
index 4db9323251e36e16b247bb3fe9d585c1fa537d37..f5cef6e5fa3e29f8fc909253372200a0d6c66a80 100644 (file)
@@ -5820,7 +5820,7 @@ static void atlas7_gpio_handle_irq(struct irq_desc *desc)
                                __func__, gc->label,
                                bank->gpio_offset + pin_in_bank);
                        generic_handle_irq(
-                               irq_find_mapping(gc->irqdomain,
+                               irq_find_mapping(gc->irq.domain,
                                        bank->gpio_offset + pin_in_bank));
                }
 
index d3ef05973901ad52ad319ac47f8d0e27a55bebd0..8b14a1f1e67159bc577c06e17246742947e7b83c 100644 (file)
@@ -587,7 +587,7 @@ static void sirfsoc_gpio_handle_irq(struct irq_desc *desc)
                if ((status & 0x1) && (ctrl & SIRFSOC_GPIO_CTL_INTR_EN_MASK)) {
                        pr_debug("%s: gpio id %d idx %d happens\n",
                                __func__, bank->id, idx);
-                       generic_handle_irq(irq_find_mapping(gc->irqdomain, idx +
+                       generic_handle_irq(irq_find_mapping(gc->irq.domain, idx +
                                        bank->id * SIRFSOC_GPIO_BANK_SIZE));
                }
 
index cf6d68c7345be71239f85a30db164b141a451b5d..72ae6bccee55f2522d02d582434767a78264e0c7 100644 (file)
@@ -401,7 +401,7 @@ static void plgpio_irq_handler(struct irq_desc *desc)
                        /* get correct irq line number */
                        pin = i * MAX_GPIO_PER_REG + pin;
                        generic_handle_irq(
-                               irq_find_mapping(gc->irqdomain, pin));
+                               irq_find_mapping(gc->irq.domain, pin));
                }
        }
        chained_irq_exit(irqchip, desc);
index 92dc230ef5b2cc9ac4b2f2db30529f45a1c0a1cb..f6b3af73dea584c9585618a5aaf7ca031c7455bf 100644 (file)
@@ -119,7 +119,7 @@ static irqreturn_t int0002_irq(int irq, void *data)
        if (!(gpe_sts_reg & GPE0A_PME_B0_STS_BIT))
                return IRQ_NONE;
 
-       generic_handle_irq(irq_find_mapping(chip->irqdomain,
+       generic_handle_irq(irq_find_mapping(chip->irq.domain,
                                            GPE0A_PME_B0_VIRT_GPIO_PIN));
 
        pm_system_wakeup();
index a79b3b18fadd050932bb4cd05bb5fc96fa94ea47..c5dfa8c0b82971e5fc258ab4dba22eda44502d1e 100644 (file)
@@ -31,6 +31,14 @@ struct gpio_irq_chip {
         */
        struct irq_chip *chip;
 
+       /**
+        * @domain:
+        *
+        * Interrupt translation domain; responsible for mapping between GPIO
+        * hwirq number and Linux IRQ number.
+        */
+       struct irq_domain *domain;
+
        /**
         * @domain_ops:
         *
@@ -124,8 +132,6 @@ static inline struct gpio_irq_chip *to_gpio_irq_chip(struct irq_chip *chip)
  *     safely.
  * @bgpio_dir: shadowed direction register for generic GPIO to clear/set
  *     direction safely.
- * @irqdomain: Interrupt translation domain; responsible for mapping
- *     between GPIO hwirq number and linux irq number
  * @irq_handler: the irq handler to use (often a predefined irq core function)
  *     for GPIO IRQs, provided by GPIO driver
  * @irq_default_type: default IRQ triggering type applied during GPIO driver
@@ -208,7 +214,6 @@ struct gpio_chip {
         * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib
         * to handle IRQs for most practical cases.
         */
-       struct irq_domain       *irqdomain;
        irq_flow_handler_t      irq_handler;
        unsigned int            irq_default_type;
        unsigned int            irq_chained_parent;