From 59f9dfae5821460d5ffb1126f9cb064bc8acff91 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Tue, 14 Dec 2021 10:24:39 -0600 Subject: [PATCH] drivers: timer: mcux_gpt: Enable GPT timer to run in doze mode GPT timer must continue running in low power modes, as it is the system wakeup source. Set configuration to ensure peripheral will not stop running in low power modes. Signed-off-by: Daniel DeGrasse --- drivers/timer/mcux_gpt_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/timer/mcux_gpt_timer.c b/drivers/timer/mcux_gpt_timer.c index 050d33769fb..67d5654c323 100644 --- a/drivers/timer/mcux_gpt_timer.c +++ b/drivers/timer/mcux_gpt_timer.c @@ -317,6 +317,10 @@ int sys_clock_driver_init(const struct device *dev) base = (GPT_Type *)DT_REG_ADDR(GPT_INST); GPT_GetDefaultConfig(&gpt_config); + /* Enable GPT timer to run in SOC low power states */ + gpt_config.enableRunInStop = true; + gpt_config.enableRunInWait = true; + gpt_config.enableRunInDoze = true; /* Use 32KHz clock frequency */ gpt_config.clockSource = kGPT_ClockSource_LowFreq; gpt_config.enableFreeRun = false; /* Set GPT to reset mode */