aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_wakeup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm_wakeup.h')
-rw-r--r--include/linux/pm_wakeup.h38
1 files changed, 24 insertions, 14 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index 0aae7776185e..22d64c18056c 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -25,32 +25,34 @@
25# error "please don't include this file directly" 25# error "please don't include this file directly"
26#endif 26#endif
27 27
28#include <linux/types.h>
29
28#ifdef CONFIG_PM 30#ifdef CONFIG_PM
29 31
30/* changes to device_may_wakeup take effect on the next pm state change. 32/* changes to device_may_wakeup take effect on the next pm state change.
31 * by default, devices should wakeup if they can. 33 * by default, devices should wakeup if they can.
32 */ 34 */
33static inline void device_init_wakeup(struct device *dev, int val) 35static inline void device_init_wakeup(struct device *dev, bool val)
34{ 36{
35 dev->power.can_wakeup = dev->power.should_wakeup = !!val; 37 dev->power.can_wakeup = dev->power.should_wakeup = val;
36} 38}
37 39
38static inline void device_set_wakeup_capable(struct device *dev, int val) 40static inline void device_set_wakeup_capable(struct device *dev, bool capable)
39{ 41{
40 dev->power.can_wakeup = !!val; 42 dev->power.can_wakeup = capable;
41} 43}
42 44
43static inline int device_can_wakeup(struct device *dev) 45static inline bool device_can_wakeup(struct device *dev)
44{ 46{
45 return dev->power.can_wakeup; 47 return dev->power.can_wakeup;
46} 48}
47 49
48static inline void device_set_wakeup_enable(struct device *dev, int val) 50static inline void device_set_wakeup_enable(struct device *dev, bool enable)
49{ 51{
50 dev->power.should_wakeup = !!val; 52 dev->power.should_wakeup = enable;
51} 53}
52 54
53static inline int device_may_wakeup(struct device *dev) 55static inline bool device_may_wakeup(struct device *dev)
54{ 56{
55 return dev->power.can_wakeup && dev->power.should_wakeup; 57 return dev->power.can_wakeup && dev->power.should_wakeup;
56} 58}
@@ -58,20 +60,28 @@ static inline int device_may_wakeup(struct device *dev)
58#else /* !CONFIG_PM */ 60#else /* !CONFIG_PM */
59 61
60/* For some reason the next two routines work even without CONFIG_PM */ 62/* For some reason the next two routines work even without CONFIG_PM */
61static inline void device_init_wakeup(struct device *dev, int val) 63static inline void device_init_wakeup(struct device *dev, bool val)
62{ 64{
63 dev->power.can_wakeup = !!val; 65 dev->power.can_wakeup = val;
64} 66}
65 67
66static inline void device_set_wakeup_capable(struct device *dev, int val) { } 68static inline void device_set_wakeup_capable(struct device *dev, bool capable)
69{
70}
67 71
68static inline int device_can_wakeup(struct device *dev) 72static inline bool device_can_wakeup(struct device *dev)
69{ 73{
70 return dev->power.can_wakeup; 74 return dev->power.can_wakeup;
71} 75}
72 76
73#define device_set_wakeup_enable(dev, val) do {} while (0) 77static inline void device_set_wakeup_enable(struct device *dev, bool enable)
74#define device_may_wakeup(dev) 0 78{
79}
80
81static inline bool device_may_wakeup(struct device *dev)
82{
83 return false;
84}
75 85
76#endif /* !CONFIG_PM */ 86#endif /* !CONFIG_PM */
77 87