Skip to content

Commit 67d33ae

Browse files
andy-shevwesteri
authored andcommitted
pinctrl: cherryview: Allocate IRQ chip dynamic
Keeping the IRQ chip definition static shares it with multiple instances of the GPIO chip in the system. This is bad and now we get this warning from GPIO library: "detected irqchip that is shared with multiple gpiochips: please fix the driver." Hence, move the IRQ chip definition from being driver static into the struct intel_pinctrl. So a unique IRQ chip is used for each GPIO chip instance. This patch is heavily based on the attachment to the bug by Christoph Marz. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=202543 Fixes: 6e08d6b ("pinctrl: Add Intel Cherryview/Braswell pin controller support") Depends-on: 83b9dc1 ("pinctrl: cherryview: Associate IRQ descriptors to irqdomain") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 63bdef6 commit 67d33ae

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct chv_pin_context {
147147
* @pctldesc: Pin controller description
148148
* @pctldev: Pointer to the pin controller device
149149
* @chip: GPIO chip in this pin controller
150+
* @irqchip: IRQ chip in this pin controller
150151
* @regs: MMIO registers
151152
* @intr_lines: Stores mapping between 16 HW interrupt wires and GPIO
152153
* offset (in GPIO number space)
@@ -162,6 +163,7 @@ struct chv_pinctrl {
162163
struct pinctrl_desc pctldesc;
163164
struct pinctrl_dev *pctldev;
164165
struct gpio_chip chip;
166+
struct irq_chip irqchip;
165167
void __iomem *regs;
166168
unsigned intr_lines[16];
167169
const struct chv_community *community;
@@ -1466,16 +1468,6 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type)
14661468
return 0;
14671469
}
14681470

1469-
static struct irq_chip chv_gpio_irqchip = {
1470-
.name = "chv-gpio",
1471-
.irq_startup = chv_gpio_irq_startup,
1472-
.irq_ack = chv_gpio_irq_ack,
1473-
.irq_mask = chv_gpio_irq_mask,
1474-
.irq_unmask = chv_gpio_irq_unmask,
1475-
.irq_set_type = chv_gpio_irq_type,
1476-
.flags = IRQCHIP_SKIP_SET_WAKE,
1477-
};
1478-
14791471
static void chv_gpio_irq_handler(struct irq_desc *desc)
14801472
{
14811473
struct gpio_chip *gc = irq_desc_get_handler_data(desc);
@@ -1625,7 +1617,15 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
16251617
}
16261618
}
16271619

1628-
ret = gpiochip_irqchip_add(chip, &chv_gpio_irqchip, 0,
1620+
pctrl->irqchip.name = "chv-gpio";
1621+
pctrl->irqchip.irq_startup = chv_gpio_irq_startup;
1622+
pctrl->irqchip.irq_ack = chv_gpio_irq_ack;
1623+
pctrl->irqchip.irq_mask = chv_gpio_irq_mask;
1624+
pctrl->irqchip.irq_unmask = chv_gpio_irq_unmask;
1625+
pctrl->irqchip.irq_set_type = chv_gpio_irq_type;
1626+
pctrl->irqchip.flags = IRQCHIP_SKIP_SET_WAKE;
1627+
1628+
ret = gpiochip_irqchip_add(chip, &pctrl->irqchip, 0,
16291629
handle_bad_irq, IRQ_TYPE_NONE);
16301630
if (ret) {
16311631
dev_err(pctrl->dev, "failed to add IRQ chip\n");
@@ -1642,7 +1642,7 @@ static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
16421642
}
16431643
}
16441644

1645-
gpiochip_set_chained_irqchip(chip, &chv_gpio_irqchip, irq,
1645+
gpiochip_set_chained_irqchip(chip, &pctrl->irqchip, irq,
16461646
chv_gpio_irq_handler);
16471647
return 0;
16481648
}

0 commit comments

Comments
 (0)