Skip to content

Commit efe34d0

Browse files
mmahadevan108kartben
authored andcommitted
drivers: nxp: Use a MACRO to enable Wakeup signals
Switch to using the new NXP_ENABLE_WAKEUP_SIGNAL and NXP_DISABLE_WAKEUP_SIGNAL macros to avoid adding platform specific calls in the Zephyr drivers. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent b0624af commit efe34d0

File tree

7 files changed

+19
-50
lines changed

7 files changed

+19
-50
lines changed

drivers/counter/counter_mcux_lpc_rtc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <fsl_rtc.h>
1010
#include "fsl_power.h"
1111
#include <zephyr/logging/log.h>
12+
#include <soc.h>
1213

1314
LOG_MODULE_REGISTER(mcux_rtc, CONFIG_COUNTER_LOG_LEVEL);
1415

@@ -254,7 +255,7 @@ static DEVICE_API(counter, mcux_rtc_driver_api) = {
254255
irq_enable(DT_INST_IRQN(id)); \
255256
IF_ENABLED(CONFIG_PM, ( \
256257
if (DT_INST_PROP(id, wakeup_source)) { \
257-
EnableDeepSleepIRQ(DT_INST_IRQN(id)); \
258+
NXP_ENABLE_WAKEUP_SIGNAL(DT_INST_IRQN(id)); \
258259
} \
259260
)) \
260261
}
@@ -432,7 +433,7 @@ static DEVICE_API(counter, mcux_rtc_highres_driver_api) = {
432433
irq_enable(DT_IRQN(DT_INST_PARENT(n))); \
433434
IF_ENABLED(CONFIG_PM, ( \
434435
if (DT_INST_PROP(n, wakeup_source)) { \
435-
EnableDeepSleepIRQ(DT_IRQN(DT_INST_PARENT(n))); \
436+
NXP_ENABLE_WAKEUP_SIGNAL(DT_IRQN(DT_INST_PARENT(n))); \
436437
} \
437438
)) \
438439
} while (false)

drivers/interrupt_controller/intc_nxp_pint.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#include <zephyr/pm/device.h>
1414

1515
#include <fsl_inputmux.h>
16-
17-
#include "intc_nxp_pint/power.h"
16+
#include <soc.h>
1817

1918
#define DT_DRV_COMPAT nxp_pint
2019

@@ -96,7 +95,12 @@ int nxp_pint_pin_enable(uint8_t pin, enum nxp_pint_trigger trigger, bool wake)
9695
* driver handles the IRQ
9796
*/
9897
PINT_PinInterruptConfig(pint_base, slot, trigger, NULL);
99-
nxp_pint_pin_deep_sleep_irq(pint_irq_cfg[slot].irq, wake);
98+
if (wake) {
99+
NXP_ENABLE_WAKEUP_SIGNAL(pint_irq_cfg[slot].irq);
100+
} else {
101+
NXP_DISABLE_WAKEUP_SIGNAL(pint_irq_cfg[slot].irq);
102+
irq_enable(pint_irq_cfg[slot].irq);
103+
}
100104

101105
return 0;
102106
}

drivers/interrupt_controller/intc_nxp_pint/power.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

drivers/serial/uart_mcux_flexcomm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,11 +1373,12 @@ DT_INST_FOREACH_STATUS_OKAY(UART_MCUX_FLEXCOMM_RX_TIMEOUT_FUNC);
13731373
#endif /* CONFIG_UART_ASYNC_API */
13741374

13751375
#if FC_UART_IS_WAKEUP
1376+
13761377
#define UART_MCUX_FLEXCOMM_WAKEUP_CFG_DEFINE(n) \
13771378
static void serial_mcux_flexcomm_##n##_wakeup_cfg(void) \
13781379
{ \
13791380
IF_ENABLED(DT_INST_PROP(n, wakeup_source), ( \
1380-
POWER_EnableWakeup(DT_INST_IRQN(n)); \
1381+
NXP_ENABLE_WAKEUP_SIGNAL(DT_INST_IRQN(n)); \
13811382
)) \
13821383
}
13831384
#define UART_MCUX_FLEXCOMM_WAKEUP_CFG_BIND(n) \

drivers/timer/mcux_os_timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#if !defined(CONFIG_SOC_FAMILY_MCXN) && !defined(CONFIG_SOC_FAMILY_MCXA)
2121
#include "fsl_power.h"
2222
#endif
23+
#include <soc.h>
2324

2425
#define CYC_PER_TICK \
2526
((uint32_t)((uint64_t)sys_clock_hw_cycles_per_sec() / \
@@ -340,7 +341,7 @@ static int sys_clock_driver_init(void)
340341
#endif
341342

342343
#if (DT_INST_PROP(0, wakeup_source))
343-
EnableDeepSleepIRQ(DT_INST_IRQN(0));
344+
NXP_ENABLE_WAKEUP_SIGNAL(DT_INST_IRQN(0));
344345
#endif
345346
return 0;
346347
}

drivers/wifi/nxp/nxp_wifi_drv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,9 +2028,9 @@ static int nxp_wifi_dev_init(const struct device *dev)
20282028
IRQ_CONNECT(IMU_WAKEUP_IRQ_N, IMU_WAKEUP_IRQ_P, WL_MCI_WAKEUP_DONE0_DriverIRQHandler, 0, 0);
20292029
irq_enable(IMU_WAKEUP_IRQ_N);
20302030
#if (DT_INST_PROP(0, wakeup_source))
2031-
EnableDeepSleepIRQ(IMU_IRQ_N);
2032-
#endif
2033-
#endif
2031+
NXP_ENABLE_WAKEUP_SIGNAL(IMU_IRQ_N);
2032+
#endif /* DT_INST_PROP */
2033+
#endif /* CONFIG_NXP_RW610 */
20342034

20352035
return 0;
20362036
}

soc/nxp/common/nxp_nbu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/* Includes */
1414
/* -------------------------------------------------------------------------- */
1515
#include <zephyr/irq.h>
16+
#include <soc.h>
1617

1718
/* -------------------------------------------------------------------------- */
1819
/* Definitions */
@@ -49,7 +50,7 @@ void nxp_nbu_init(void)
4950
irq_enable(NBU_WAKE_UP_IRQ_N);
5051
#endif
5152
#if (DT_INST_PROP(0, wakeup_source)) && CONFIG_PM
52-
EnableDeepSleepIRQ(NBU_RX_IRQ_N);
53+
NXP_ENABLE_WAKEUP_SIGNAL(NBU_RX_IRQ_N);
5354
#endif
5455

5556
#endif

0 commit comments

Comments
 (0)