Commit 13e152a5 authored by Martin Hoff's avatar Martin Hoff Committed by Fabio Baltieri
Browse files

drivers: gpio: gecko: add check for interrupt configuration



Add a check for interrupt configuration: if the interrupt line for the
pin is already enabled but for the same port that the user asked, it
should not return EBUSY.

Signed-off-by: default avatarMartin Hoff <martin.hoff@silabs.com>
parent ac2d1e66
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -292,11 +292,11 @@ static int gpio_gecko_pin_interrupt_configure(const struct device *dev,
	} else {
		/* Interrupt line is already in use */
		if ((GPIO->IEN & BIT(pin)) != 0) {
			/* TODO: Return an error only if request is done for
			 * a pin from a different port.
			 */
			/* Check if the interrupt is already configured for this port */
			if (!(data->int_enabled_mask & BIT(pin))) {
				return -EBUSY;
			}
		}

		bool rising_edge = true;
		bool falling_edge = true;