Commit c29aa88f authored by Aksel Skauge Mellbye's avatar Aksel Skauge Mellbye Committed by Benjamin Cabé
Browse files

include: zephyr: drivers: gpio: Propagate GPIO_INT_WAKEUP flag

The GPIO_INT_WAKEUP flag is available in the binding header,
but was not propagated from dt_flags in the interrupt_configure_dt
function. Allow GPIOs to be declared as wakeup sources in dts
by propagating the flag.

Signed-off-by: default avatarAksel Skauge Mellbye <aksel.mellbye@silabs.com>
parent a8cd0a36
Loading
Loading
Loading
Loading
+6 −3
Changes for include/zephyr/drivers/gpio.h: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -948,9 +948,11 @@ static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port,
 *
 * This is equivalent to:
 *
 *     gpio_pin_interrupt_configure(spec->port, spec->pin, flags);
 *     gpio_pin_interrupt_configure(spec->port, spec->pin, combined_flags);
 *
 * The <tt>spec->dt_flags</tt> value is not used.
 * Where <tt>combined_flags</tt> is the combination of the <tt>flags</tt> argument
 * and the <tt>GPIO_INT_WAKEUP</tt> flag from <tt>spec->dt_flags</tt> if set. Other
 * flags from <tt>spec->dt_flags</tt> are ignored.
 *
 * @param spec GPIO specification from devicetree
 * @param flags interrupt configuration flags
@@ -959,7 +961,8 @@ static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port,
static inline int gpio_pin_interrupt_configure_dt(const struct gpio_dt_spec *spec,
						  gpio_flags_t flags)
{
	return gpio_pin_interrupt_configure(spec->port, spec->pin, flags);
	return gpio_pin_interrupt_configure(spec->port, spec->pin,
					    flags | (spec->dt_flags & GPIO_INT_WAKEUP));
}

/**