Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drivers/pinctrl/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ config PINCTRL_DYNAMIC
runtime. This can be useful, for example, to change the pins assigned to a
peripheral at early boot stages depending on a certain input.

config PINCTRL_KEEP_SLEEP_STATE
bool "Keep sleep state"
default y if PM || PM_DEVICE || DEVICE_DEINIT_SUPPORT

source "drivers/pinctrl/Kconfig.b91"
source "drivers/pinctrl/Kconfig.bflb"
source "drivers/pinctrl/Kconfig.ambiq"
Expand Down
8 changes: 7 additions & 1 deletion drivers/serial/uart_nrfx_uarte.c
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,11 @@ static int uarte_instance_init(const struct device *dev,
return pm_device_driver_init(dev, uarte_nrfx_pm_action);
}

static int uarte_instance_deinit(const struct device *dev)
{
return pm_device_driver_deinit(dev, uarte_nrfx_pm_action);
}

#define UARTE_GET_ISR(idx) \
COND_CODE_1(CONFIG_UART_##idx##_ASYNC, (uarte_nrfx_isr_async), (uarte_nrfx_isr_int))

Expand Down Expand Up @@ -2800,8 +2805,9 @@ static int uarte_instance_init(const struct device *dev,
PM_DEVICE_DT_DEFINE(UARTE(idx), uarte_nrfx_pm_action, \
UARTE_PM_ISR_SAFE(idx)); \
\
DEVICE_DT_DEFINE(UARTE(idx), \
DEVICE_DT_DEINIT_DEFINE(UARTE(idx), \
uarte_##idx##_init, \
uarte_instance_deinit, \
PM_DEVICE_DT_GET(UARTE(idx)), \
&uarte_##idx##_data, \
&uarte_##idx##z_config, \
Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/drivers/pinctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct pinctrl_dev_config {

/** @cond INTERNAL_HIDDEN */

#if !defined(CONFIG_PM) && !defined(CONFIG_PM_DEVICE)
#if !defined(CONFIG_PINCTRL_KEEP_SLEEP_STATE)
/** Out of power management configurations, ignore "sleep" state. */
#define PINCTRL_SKIP_SLEEP 1
#endif
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/pinctrl/api/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
CONFIG_ZTEST=y
CONFIG_PINCTRL=y
CONFIG_PINCTRL_DYNAMIC=y
CONFIG_DEVICE_DEINIT_SUPPORT=n