Skip to content

Commit 075aae2

Browse files
committed
drivers: counter: nxp_mrt: Support power device constraint
Call pm_policy_device_power_lock_put/pm_policy_device_power_lock_get to coordinate with system level power modes. Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
1 parent 50089c4 commit 075aae2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/counter/counter_nxp_mrt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <zephyr/irq.h>
2424
#include <zephyr/drivers/reset.h>
2525
#include <zephyr/pm/device.h>
26+
#include <zephyr/pm/policy.h>
2627

2728
#include <soc.h>
2829

@@ -73,6 +74,8 @@ static int nxp_mrt_stop(const struct device *dev)
7374
/* LOAD bit and 0 ivalue allows us to forcibly stop the timer */
7475
base->CHANNEL[channel_id].INTVAL = MRT_CHANNEL_INTVAL_LOAD(1);
7576

77+
pm_policy_device_power_lock_put(dev);
78+
7679
return 0;
7780
}
7881

@@ -90,6 +93,8 @@ static int nxp_mrt_start(const struct device *dev)
9093
data->top = config->info.max_top_value;
9194
}
9295

96+
pm_policy_device_power_lock_get(dev);
97+
9398
/* Start with previously configured top value (if already running this has no effect) */
9499
base->CHANNEL[channel_id].INTVAL = data->top;
95100

drivers/dma/dma_mcux_lpc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,12 +1027,12 @@ static void dma_mcux_lpc_restore_reg(const struct device *dev)
10271027

10281028
#else /* !CONFIG_PM_DEVICE */
10291029

1030-
static inline static void dma_mcux_lpc_backup_reg(const struct device *dev)
1030+
static inline void dma_mcux_lpc_backup_reg(const struct device *dev)
10311031
{
10321032
ARG_UNUSED(dev);
10331033
}
10341034

1035-
static inline static void dma_mcux_lpc_restore_reg(const struct device *dev)
1035+
static inline void dma_mcux_lpc_restore_reg(const struct device *dev)
10361036
{
10371037
ARG_UNUSED(dev);
10381038
}

0 commit comments

Comments
 (0)