1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 /**
7  * @file Common pm_s2ram.h include for Nordic SoCs.
8  */
9 
10 #ifndef _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
11 #define _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_
12 
13 /**
14  * @brief Save CPU state on suspend
15  *
16  * This function is used on suspend-to-RAM (S2RAM) to save the CPU state in
17  * (retained) RAM before powering the system off using the provided function.
18  * This function is usually called from the PM subsystem / hooks.
19  *
20  * The CPU state consist of internal registers and peripherals like
21  * interrupt controller, memory controllers, etc.
22  *
23  * @param system_off	Function to power off the system.
24  *
25  * @retval 0		The CPU context was successfully saved and restored.
26  * @retval -EBUSY	The system is busy and cannot be suspended at this time.
27  * @retval -errno	Negative errno code in case of failure.
28  */
29 int soc_s2ram_suspend(pm_s2ram_system_off_fn_t system_off);
30 
31 #endif /* _ZEPHYR_SOC_ARM_NORDIC_NRF_PM_S2RAM_H_ */
32