Skip to content
Open
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
7 changes: 4 additions & 3 deletions drivers/serial/uart_mcux_flexcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct mcux_flexcomm_data {
bool pm_policy_state_lock;
struct k_work pm_lock_work;
#endif
uint32_t usart_intenset;
};

#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
Expand Down Expand Up @@ -1205,10 +1206,10 @@ static void mcux_flexcomm_pm_restore_wake(const struct device *dev,
}
#endif /* FC_UART_IS_WAKEUP */

static uint32_t usart_intenset;
static int mcux_flexcomm_pm_action(const struct device *dev, enum pm_device_action action)
{
const struct mcux_flexcomm_config *config = dev->config;
struct mcux_flexcomm_data *data = dev->data;
int ret;

switch (action) {
Expand All @@ -1217,14 +1218,14 @@ static int mcux_flexcomm_pm_action(const struct device *dev, enum pm_device_acti
case PM_DEVICE_ACTION_SUSPEND:
break;
case PM_DEVICE_ACTION_TURN_OFF:
usart_intenset = USART_GetEnabledInterrupts(config->base);
data->usart_intenset = USART_GetEnabledInterrupts(config->base);
break;
case PM_DEVICE_ACTION_TURN_ON:
ret = mcux_flexcomm_init_common(dev);
if (ret) {
return ret;
}
USART_EnableInterrupts(config->base, usart_intenset);
USART_EnableInterrupts(config->base, data->usart_intenset);
break;
default:
return -ENOTSUP;
Expand Down
Loading