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