pinctrl: nuvoton: npcm8xx: clear polarity before set both edge
authorTomer Maimon <tmaimon77@gmail.com>
Tue, 16 Jul 2024 19:40:04 +0000 (22:40 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 5 Aug 2024 07:32:34 +0000 (09:32 +0200)
Clear polarity before setting both edges to ensure that the polarity is
in the same state before configuring events for both edges

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
Link: https://lore.kernel.org/20240716194008.3502068-4-tmaimon77@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c

index 2df735947d86708f97c9fa9cd0dcdfd58dee1d7d..7985400de12ab64520c7d8f2768039e63cd2c32f 100644 (file)
@@ -241,6 +241,7 @@ static int npcmgpio_set_irq_type(struct irq_data *d, unsigned int type)
                npcm_gpio_set(&bank->gc, bank->base + NPCM8XX_GP_N_POL, gpio);
                break;
        case IRQ_TYPE_EDGE_BOTH:
+               npcm_gpio_clr(&bank->gc, bank->base + NPCM8XX_GP_N_POL, gpio);
                npcm_gpio_set(&bank->gc, bank->base + NPCM8XX_GP_N_EVBE, gpio);
                break;
        case IRQ_TYPE_LEVEL_LOW: