Skip to content

Commit f1dea50

Browse files
pabigotgalak
authored andcommitted
drivers: gpio: gecko: fix interrupt clear
In order to reliably detect interrupts the interrupt must be acknowledged before the callback is invoked. Signed-off-by: Peter Bigot <[email protected]>
1 parent 7e9f7bf commit f1dea50

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpio/gpio_gecko.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,13 @@ static void gpio_gecko_common_isr(void *arg)
345345
port_dev = data->ports[i];
346346
port_data = port_dev->driver_data;
347347
enabled_int = int_status & port_data->pin_callback_enables;
348-
int_status &= ~enabled_int;
349-
350-
gpio_fire_callbacks(&port_data->callbacks, port_dev,
351-
enabled_int);
348+
if (enabled_int != 0) {
349+
int_status &= ~enabled_int;
350+
GPIO->IFC = enabled_int;
351+
gpio_fire_callbacks(&port_data->callbacks, port_dev,
352+
enabled_int);
353+
}
352354
}
353-
/* Clear the pending interrupts */
354-
GPIO->IFC = 0xFFFF;
355355
}
356356

357357

0 commit comments

Comments
 (0)