| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* |
| 3 | * syscore_ops.h - System core operations. |
| 4 | * |
| 5 | * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. |
| 6 | */ |
| 7 | |
| 8 | #ifndef _LINUX_SYSCORE_OPS_H |
| 9 | #define _LINUX_SYSCORE_OPS_H |
| 10 | |
| 11 | #include <linux/list.h> |
| 12 | |
| 13 | struct syscore_ops { |
| 14 | int (*suspend)(void *data); |
| 15 | void (*resume)(void *data); |
| 16 | void (*shutdown)(void *data); |
| 17 | }; |
| 18 | |
| 19 | struct syscore { |
| 20 | struct list_head node; |
| 21 | const struct syscore_ops *ops; |
| 22 | void *data; |
| 23 | }; |
| 24 | |
| 25 | extern void register_syscore(struct syscore *syscore); |
| 26 | extern void unregister_syscore(struct syscore *syscore); |
| 27 | #ifdef CONFIG_PM_SLEEP |
| 28 | extern int syscore_suspend(void); |
| 29 | extern void syscore_resume(void); |
| 30 | #endif |
| 31 | extern void syscore_shutdown(void); |
| 32 | |
| 33 | #endif |
| 34 | |