From: Ben Wolsieffer <ben.wolsieffer@hefring.com>
To: linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Linus Walleij <linus.walleij@linaro.org>,
Ben Wolsieffer <ben.wolsieffer@hefring.com>
Subject: [PATCH 1/2] irqchip/stm32-exti: support retriggering on STM32 MCUs
Date: Mon, 4 Dec 2023 15:33:56 -0500 [thread overview]
Message-ID: <20231204203357.2897008-2-ben.wolsieffer@hefring.com> (raw)
In-Reply-To: <20231204203357.2897008-1-ben.wolsieffer@hefring.com>
EXTI retriggering support was missing on STM32 MCUs. Retriggering is
required to emulate GPIO level interrupts using edge interrupts in the
STM32 pinctrl driver.
Signed-off-by: Ben Wolsieffer <ben.wolsieffer@hefring.com>
---
drivers/irqchip/irq-stm32-exti.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
index 971240e2e31b..6b3f54457812 100644
--- a/drivers/irqchip/irq-stm32-exti.c
+++ b/drivers/irqchip/irq-stm32-exti.c
@@ -328,6 +328,18 @@ static void stm32_irq_handler(struct irq_desc *desc)
chained_irq_exit(chip, desc);
}
+static int stm32_irq_retrigger(struct irq_data *d)
+{
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct stm32_exti_chip_data *chip_data = gc->private;
+ const struct stm32_exti_bank *stm32_bank = chip_data->reg_bank;
+ u32 mask = BIT(d->hwirq % IRQS_PER_BANK);
+
+ irq_reg_writel(gc, mask, stm32_bank->swier_ofst);
+
+ return 0;
+}
+
static int stm32_exti_set_type(struct irq_data *d,
unsigned int type, u32 *rtsr, u32 *ftsr)
{
@@ -856,6 +868,7 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data,
gc->chip_types->chip.irq_ack = stm32_irq_ack;
gc->chip_types->chip.irq_mask = irq_gc_mask_clr_bit;
gc->chip_types->chip.irq_unmask = irq_gc_mask_set_bit;
+ gc->chip_types->chip.irq_retrigger = stm32_irq_retrigger;
gc->chip_types->chip.irq_set_type = stm32_irq_set_type;
gc->chip_types->chip.irq_set_wake = irq_gc_set_wake;
gc->suspend = stm32_irq_suspend;
--
2.42.1
next prev parent reply other threads:[~2023-12-04 20:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 20:33 [PATCH 0/2] stm32: fix GPIO level interrupts Ben Wolsieffer
2023-12-04 20:33 ` Ben Wolsieffer [this message]
2023-12-04 20:33 ` [PATCH 2/2] pinctrl: " Ben Wolsieffer
2023-12-07 9:56 ` Linus Walleij
2023-12-07 9:59 ` Linus Walleij
2023-12-08 20:43 ` Thomas Gleixner
2023-12-12 15:35 ` Ben Wolsieffer
2023-12-12 19:32 ` Thomas Gleixner
2023-12-14 17:12 ` [Linux-stm32] " Antonio Borneo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231204203357.2897008-2-ben.wolsieffer@hefring.com \
--to=ben.wolsieffer@hefring.com \
--cc=alexandre.torgue@foss.st.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®