1 /*
2  * include/linux/wakeup_reason.h
3  *
4  * Logs the reason which caused the kernel to resume
5  * from the suspend mode.
6  *
7  * Copyright (C) 2014 Google, Inc.
8  * This software is licensed under the terms of the GNU General Public
9  * License version 2, as published by the Free Software Foundation, and
10  * may be copied, distributed, and modified under those terms.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  */
17 
18 #ifndef _LINUX_WAKEUP_REASON_H
19 #define _LINUX_WAKEUP_REASON_H
20 
21 #define MAX_SUSPEND_ABORT_LEN 256
22 
23 #ifdef CONFIG_SUSPEND
24 void log_irq_wakeup_reason(int irq);
25 void log_threaded_irq_wakeup_reason(int irq, int parent_irq);
26 void log_suspend_abort_reason(const char *fmt, ...);
27 void log_abnormal_wakeup_reason(const char *fmt, ...);
28 void clear_wakeup_reasons(void);
29 #else
log_irq_wakeup_reason(int irq)30 static inline void log_irq_wakeup_reason(int irq)
31 {
32 }
log_threaded_irq_wakeup_reason(int irq, int parent_irq)33 static inline void log_threaded_irq_wakeup_reason(int irq, int parent_irq)
34 {
35 }
log_suspend_abort_reason(const char *fmt, ...)36 static inline void log_suspend_abort_reason(const char *fmt, ...)
37 {
38 }
log_abnormal_wakeup_reason(const char *fmt, ...)39 static inline void log_abnormal_wakeup_reason(const char *fmt, ...)
40 {
41 }
clear_wakeup_reasons(void)42 static inline void clear_wakeup_reasons(void)
43 {
44 }
45 #endif
46 
47 #endif /* _LINUX_WAKEUP_REASON_H */
48