mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
gpio: davinci: Make irq_chip immutable
Kernel warns about mutable irq_chips: "not an immutable chip, please consider fixing!" Constify gpio_irqchip, flag the irq_chip as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250509-gpio-v1-6-639377c98288@nxp.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
62be72bdb0
commit
3f50bb3124
1 changed files with 7 additions and 2 deletions
|
@ -253,6 +253,8 @@ static void gpio_irq_mask(struct irq_data *d)
|
||||||
|
|
||||||
writel_relaxed(mask, &g->clr_falling);
|
writel_relaxed(mask, &g->clr_falling);
|
||||||
writel_relaxed(mask, &g->clr_rising);
|
writel_relaxed(mask, &g->clr_rising);
|
||||||
|
|
||||||
|
gpiochip_disable_irq(&chips->chip, hwirq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gpio_irq_unmask(struct irq_data *d)
|
static void gpio_irq_unmask(struct irq_data *d)
|
||||||
|
@ -263,6 +265,8 @@ static void gpio_irq_unmask(struct irq_data *d)
|
||||||
uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
|
uintptr_t mask = (uintptr_t)irq_data_get_irq_handler_data(d);
|
||||||
unsigned status = irqd_get_trigger_type(d);
|
unsigned status = irqd_get_trigger_type(d);
|
||||||
|
|
||||||
|
gpiochip_enable_irq(&chips->chip, hwirq);
|
||||||
|
|
||||||
status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
|
status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
|
||||||
if (!status)
|
if (!status)
|
||||||
status = IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
|
status = IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING;
|
||||||
|
@ -281,12 +285,13 @@ static int gpio_irq_type(struct irq_data *d, unsigned trigger)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip gpio_irqchip = {
|
static const struct irq_chip gpio_irqchip = {
|
||||||
.name = "GPIO",
|
.name = "GPIO",
|
||||||
.irq_unmask = gpio_irq_unmask,
|
.irq_unmask = gpio_irq_unmask,
|
||||||
.irq_mask = gpio_irq_mask,
|
.irq_mask = gpio_irq_mask,
|
||||||
.irq_set_type = gpio_irq_type,
|
.irq_set_type = gpio_irq_type,
|
||||||
.flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
|
.flags = IRQCHIP_IMMUTABLE | IRQCHIP_SET_TYPE_MASKED | IRQCHIP_SKIP_SET_WAKE,
|
||||||
|
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gpio_irq_handler(struct irq_desc *desc)
|
static void gpio_irq_handler(struct irq_desc *desc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue