Commit 35d00867 authored by Linus Walleij's avatar Linus Walleij

pinctrl: plgpio: Convert to immutable irq_chip

Convert the driver to immutable irq-chip with a bit of
intuition.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230414-immutable-irqchips-2-v1-3-6b59a5186b00@linaro.org
parent 33c56e5c
......@@ -301,6 +301,7 @@ static void plgpio_irq_disable(struct irq_data *d)
spin_lock_irqsave(&plgpio->lock, flags);
plgpio_reg_set(plgpio->regmap, offset, plgpio->regs.ie);
spin_unlock_irqrestore(&plgpio->lock, flags);
gpiochip_disable_irq(gc, irqd_to_hwirq(d));
}
static void plgpio_irq_enable(struct irq_data *d)
......@@ -317,6 +318,7 @@ static void plgpio_irq_enable(struct irq_data *d)
return;
}
gpiochip_enable_irq(gc, irqd_to_hwirq(d));
spin_lock_irqsave(&plgpio->lock, flags);
plgpio_reg_reset(plgpio->regmap, offset, plgpio->regs.ie);
spin_unlock_irqrestore(&plgpio->lock, flags);
......@@ -356,11 +358,13 @@ static int plgpio_irq_set_type(struct irq_data *d, unsigned trigger)
return 0;
}
static struct irq_chip plgpio_irqchip = {
static const struct irq_chip plgpio_irqchip = {
.name = "PLGPIO",
.irq_enable = plgpio_irq_enable,
.irq_disable = plgpio_irq_disable,
.irq_set_type = plgpio_irq_set_type,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static void plgpio_irq_handler(struct irq_desc *desc)
......@@ -595,7 +599,7 @@ static int plgpio_probe(struct platform_device *pdev)
struct gpio_irq_chip *girq;
girq = &plgpio->chip.irq;
girq->chip = &plgpio_irqchip;
gpio_irq_chip_set_chip(girq, &plgpio_irqchip);
girq->parent_handler = plgpio_irq_handler;
girq->num_parents = 1;
girq->parents = devm_kcalloc(&pdev->dev, 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment