1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_SH_SUSPEND_H
3 #define _ASM_SH_SUSPEND_H
6 #include <linux/notifier.h>
8 #include <asm/ptrace.h>
10 struct swsusp_arch_regs
{
11 struct pt_regs user_regs
;
12 unsigned long bank1_regs
[8];
15 void sh_mobile_call_standby(unsigned long mode
);
17 #ifdef CONFIG_CPU_IDLE
18 int sh_mobile_setup_cpuidle(void);
20 static inline int sh_mobile_setup_cpuidle(void) { return 0; }
23 /* notifier chains for pre/post sleep hooks */
24 extern struct atomic_notifier_head sh_mobile_pre_sleep_notifier_list
;
25 extern struct atomic_notifier_head sh_mobile_post_sleep_notifier_list
;
27 /* priority levels for notifiers */
28 #define SH_MOBILE_SLEEP_BOARD 0
29 #define SH_MOBILE_SLEEP_CPU 1
30 #define SH_MOBILE_PRE(x) (x)
31 #define SH_MOBILE_POST(x) (-(x))
33 /* board code registration function for self-refresh assembly snippets */
34 void sh_mobile_register_self_refresh(unsigned long flags
,
35 void *pre_start
, void *pre_end
,
36 void *post_start
, void *post_end
);
38 /* register structure for address/data information */
39 struct sh_sleep_regs
{
58 /* data area for low-level sleep code */
59 struct sh_sleep_data
{
60 /* current sleep mode (SUSP_SH_...) */
63 /* addresses of board specific self-refresh snippets */
65 unsigned long sf_post
;
67 /* address of resume code */
70 /* register state saved and restored by the assembly code */
76 /* structure for keeping register addresses */
77 struct sh_sleep_regs addr
;
79 /* structure for saving/restoring register state */
80 struct sh_sleep_regs data
;
83 /* a bitmap of supported sleep modes (SUSP_SH..) */
84 extern unsigned long sh_mobile_sleep_supported
;
88 /* flags passed to assembly suspend code */
89 #define SUSP_SH_SLEEP (1 << 0) /* Regular sleep mode */
90 #define SUSP_SH_STANDBY (1 << 1) /* SH-Mobile Software standby mode */
91 #define SUSP_SH_RSTANDBY (1 << 2) /* SH-Mobile R-standby mode */
92 #define SUSP_SH_USTANDBY (1 << 3) /* SH-Mobile U-standby mode */
93 #define SUSP_SH_SF (1 << 4) /* Enable self-refresh */
94 #define SUSP_SH_MMU (1 << 5) /* Save/restore MMU and cache */
95 #define SUSP_SH_REGS (1 << 6) /* Save/restore registers */
97 #endif /* _ASM_SH_SUSPEND_H */