Skip to content

Commit af0c533

Browse files
linuswandy-shev
authored andcommitted
pinctrl: intel: Pass irqchip when adding gpiochip
We need to convert all old gpio irqchips to pass the irqchip setup along when adding the gpio_chip. For more info see drivers/gpio/TODO. For chained irqchips this is a pretty straight-forward conversion. Cc: Hans de Goede <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 6d416b9 commit af0c533

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,7 @@ static unsigned int intel_gpio_ngpio(const struct intel_pinctrl *pctrl)
11941194
static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
11951195
{
11961196
int ret;
1197+
struct gpio_irq_chip *girq;
11971198

11981199
pctrl->chip = intel_gpio_chip;
11991200

@@ -1214,16 +1215,9 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
12141215
pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake;
12151216
pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND;
12161217

1217-
ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
1218-
if (ret) {
1219-
dev_err(pctrl->dev, "failed to register gpiochip\n");
1220-
return ret;
1221-
}
1222-
12231218
/*
1224-
* We need to request the interrupt here (instead of providing chip
1225-
* to the irq directly) because on some platforms several GPIO
1226-
* controllers share the same interrupt line.
1219+
* On some platforms several GPIO controllers share the same interrupt
1220+
* line.
12271221
*/
12281222
ret = devm_request_irq(pctrl->dev, irq, intel_gpio_irq,
12291223
IRQF_SHARED | IRQF_NO_THREAD,
@@ -1233,14 +1227,20 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
12331227
return ret;
12341228
}
12351229

1236-
ret = gpiochip_irqchip_add(&pctrl->chip, &pctrl->irqchip, 0,
1237-
handle_bad_irq, IRQ_TYPE_NONE);
1230+
girq = &pctrl->chip.irq;
1231+
girq->chip = &pctrl->irqchip;
1232+
/* This will let us handle the IRQ in the driver */
1233+
girq->parent_handler = NULL;
1234+
girq->num_parents = 0;
1235+
girq->default_type = IRQ_TYPE_NONE;
1236+
girq->handler = handle_bad_irq;
1237+
1238+
ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
12381239
if (ret) {
1239-
dev_err(pctrl->dev, "failed to add irqchip\n");
1240+
dev_err(pctrl->dev, "failed to register gpiochip\n");
12401241
return ret;
12411242
}
12421243

1243-
gpiochip_set_chained_irqchip(&pctrl->chip, &pctrl->irqchip, irq, NULL);
12441244
return 0;
12451245
}
12461246

0 commit comments

Comments
 (0)