Skip to content

Commit c29aa88

Browse files
asmellbykartben
authored andcommitted
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: Aksel Skauge Mellbye <[email protected]>
1 parent a8cd0a3 commit c29aa88

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/zephyr/drivers/gpio.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,9 +948,11 @@ static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port,
948948
*
949949
* This is equivalent to:
950950
*
951-
* gpio_pin_interrupt_configure(spec->port, spec->pin, flags);
951+
* gpio_pin_interrupt_configure(spec->port, spec->pin, combined_flags);
952952
*
953-
* The <tt>spec->dt_flags</tt> value is not used.
953+
* Where <tt>combined_flags</tt> is the combination of the <tt>flags</tt> argument
954+
* and the <tt>GPIO_INT_WAKEUP</tt> flag from <tt>spec->dt_flags</tt> if set. Other
955+
* flags from <tt>spec->dt_flags</tt> are ignored.
954956
*
955957
* @param spec GPIO specification from devicetree
956958
* @param flags interrupt configuration flags
@@ -959,7 +961,8 @@ static inline int z_impl_gpio_pin_interrupt_configure(const struct device *port,
959961
static inline int gpio_pin_interrupt_configure_dt(const struct gpio_dt_spec *spec,
960962
gpio_flags_t flags)
961963
{
962-
return gpio_pin_interrupt_configure(spec->port, spec->pin, flags);
964+
return gpio_pin_interrupt_configure(spec->port, spec->pin,
965+
flags | (spec->dt_flags & GPIO_INT_WAKEUP));
963966
}
964967

965968
/**

0 commit comments

Comments
 (0)