diff options
author | Shiji Yang <yangshiji66@qq.com> | 2023-05-28 09:17:34 +0800 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2023-09-08 18:06:30 +0200 |
commit | 7ba69a94f924b0eefd05874d63fd616fab06ded6 (patch) | |
tree | f6aabe4e1db07f224bf39f446d2ded29de690683 /target/linux | |
parent | 54758cf24bd8123c724c59805a21d940db0b058c (diff) |
ath79: backport gpio immutable irq_chip support
This patch converts the driver to immutable irq-chip, which can
silence some gpio warnings.
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/ath79/patches-6.1/010-v6.4-gpio-ath79-Convert-to-immutable-irq_chip.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/ath79/patches-6.1/010-v6.4-gpio-ath79-Convert-to-immutable-irq_chip.patch b/target/linux/ath79/patches-6.1/010-v6.4-gpio-ath79-Convert-to-immutable-irq_chip.patch new file mode 100644 index 0000000000..942380fc7b --- /dev/null +++ b/target/linux/ath79/patches-6.1/010-v6.4-gpio-ath79-Convert-to-immutable-irq_chip.patch @@ -0,0 +1,60 @@ +From b11ce7e48121a02ceedec9f4dfcab4f2bee8f35f Mon Sep 17 00:00:00 2001 +From: Linus Walleij <linus.walleij@linaro.org> +Date: Thu, 9 Mar 2023 08:45:54 +0100 +Subject: gpio: ath79: Convert to immutable irq_chip + +Convert the driver to immutable irq-chip with a bit of +intuition. + +Cc: Marc Zyngier <maz@kernel.org> +Acked-by: Marc Zyngier <maz@kernel.org> +Signed-off-by: Linus Walleij <linus.walleij@linaro.org> +Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> +--- + drivers/gpio/gpio-ath79.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/gpio/gpio-ath79.c ++++ b/drivers/gpio/gpio-ath79.c +@@ -71,6 +71,7 @@ static void ath79_gpio_irq_unmask(struct + u32 mask = BIT(irqd_to_hwirq(data)); + unsigned long flags; + ++ gpiochip_enable_irq(&ctrl->gc, irqd_to_hwirq(data)); + raw_spin_lock_irqsave(&ctrl->lock, flags); + ath79_gpio_update_bits(ctrl, AR71XX_GPIO_REG_INT_MASK, mask, mask); + raw_spin_unlock_irqrestore(&ctrl->lock, flags); +@@ -85,6 +86,7 @@ static void ath79_gpio_irq_mask(struct i + raw_spin_lock_irqsave(&ctrl->lock, flags); + ath79_gpio_update_bits(ctrl, AR71XX_GPIO_REG_INT_MASK, mask, 0); + raw_spin_unlock_irqrestore(&ctrl->lock, flags); ++ gpiochip_disable_irq(&ctrl->gc, irqd_to_hwirq(data)); + } + + static void ath79_gpio_irq_enable(struct irq_data *data) +@@ -169,13 +171,15 @@ static int ath79_gpio_irq_set_type(struc + return 0; + } + +-static struct irq_chip ath79_gpio_irqchip = { ++static const struct irq_chip ath79_gpio_irqchip = { + .name = "gpio-ath79", + .irq_enable = ath79_gpio_irq_enable, + .irq_disable = ath79_gpio_irq_disable, + .irq_mask = ath79_gpio_irq_mask, + .irq_unmask = ath79_gpio_irq_unmask, + .irq_set_type = ath79_gpio_irq_set_type, ++ .flags = IRQCHIP_IMMUTABLE, ++ GPIOCHIP_IRQ_RESOURCE_HELPERS, + }; + + static void ath79_gpio_irq_handler(struct irq_desc *desc) +@@ -274,7 +278,7 @@ static int ath79_gpio_probe(struct platf + /* Optional interrupt setup */ + if (!np || of_property_read_bool(np, "interrupt-controller")) { + girq = &ctrl->gc.irq; +- girq->chip = &ath79_gpio_irqchip; ++ gpio_irq_chip_set_chip(girq, &ath79_gpio_irqchip); + girq->parent_handler = ath79_gpio_irq_handler; + girq->num_parents = 1; + girq->parents = devm_kcalloc(dev, 1, sizeof(*girq->parents), |