xref: /OK3568_Linux_fs/u-boot/arch/arm/include/asm/suspend.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2017 Rockchip Electronics Co., Ltd
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * SPDX-License-Identifier:     GPL-2.0+
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef SUSPEND_H
8*4882a593Smuzhiyun #define SUSPEND_H
9*4882a593Smuzhiyun #include <common.h>
10*4882a593Smuzhiyun #include <asm-generic/global_data.h>
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun /* suspend/resume core functions */
13*4882a593Smuzhiyun void cpu_suspend_save(struct pm_ctx *ptr, unsigned long sp);
14*4882a593Smuzhiyun void cpu_do_suspend(unsigned long *ptr);
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun void cpu_resume(void);
17*4882a593Smuzhiyun void cpu_do_resume(void);
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun /*
20*4882a593Smuzhiyun  * Exported to platform suspend, arg will be passed to fn as r0
21*4882a593Smuzhiyun  * Return value: 0  - cpu resumed from suspended state.
22*4882a593Smuzhiyun  *               -1 - cpu not suspended.
23*4882a593Smuzhiyun  */
24*4882a593Smuzhiyun int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
25*4882a593Smuzhiyun #endif
26