1 /*
2  * Copyright 2024 NXP
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*
8  * This file abstracts operations exposed by fsl_power.h from NXP HAL,
9  * for cases when that driver can't be compiled (DSP targets).
10  */
11 
12 #ifndef __ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_NXP_PINT_POWER_H__
13 #define __ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_NXP_PINT_POWER_H__
14 
15 #include <stdbool.h>
16 #include <zephyr/irq.h>
17 #include <fsl_pint.h>
18 
19 #if defined(FSL_FEATURE_SOC_PMC_COUNT) && FSL_FEATURE_SOC_PMC_COUNT > 0
20 #include <fsl_power.h>
21 #endif
22 
nxp_pint_pin_deep_sleep_irq(uint8_t irq,bool wake)23 static inline void nxp_pint_pin_deep_sleep_irq(uint8_t irq, bool wake)
24 {
25 #if (defined(FSL_FEATURE_SOC_PMC_COUNT) && FSL_FEATURE_SOC_PMC_COUNT > 0) &&                       \
26 	!(defined(FSL_FEATURE_POWERLIB_EXTEND) && (FSL_FEATURE_POWERLIB_EXTEND != 0))
27 	if (wake) {
28 		EnableDeepSleepIRQ(irq);
29 	} else {
30 		DisableDeepSleepIRQ(irq);
31 		irq_enable(irq);
32 	}
33 #else
34 	ARG_UNUSED(irq);
35 	ARG_UNUSED(wake);
36 #endif
37 }
38 
39 #endif
40