diff options
author | Len Brown <len.brown@intel.com> | 2011-03-18 18:06:08 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-03-18 18:06:08 -0400 |
commit | 05534c9ffc9d5d950b14de8ba49a7609dc59b0b8 (patch) | |
tree | 65a01a1e0bc0e28c64fb5105cc763949f5412b4b /include/linux/pm_wakeup.h | |
parent | dd87cc53c42f3260b7eb7f60822de0fa9e58af59 (diff) | |
parent | 589c7a39ae2f2b74fd13ae344ca1dcca61da6bca (diff) |
Merge branch 'acpica' into release
Diffstat (limited to 'include/linux/pm_wakeup.h')
-rw-r--r-- | include/linux/pm_wakeup.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 9cff00dd6b6..03a67db03d0 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h @@ -109,11 +109,6 @@ static inline bool device_can_wakeup(struct device *dev) return dev->power.can_wakeup; } -static inline bool device_may_wakeup(struct device *dev) -{ - return false; -} - static inline struct wakeup_source *wakeup_source_create(const char *name) { return NULL; @@ -134,24 +129,32 @@ static inline void wakeup_source_unregister(struct wakeup_source *ws) {} static inline int device_wakeup_enable(struct device *dev) { - return -EINVAL; + dev->power.should_wakeup = true; + return 0; } static inline int device_wakeup_disable(struct device *dev) { + dev->power.should_wakeup = false; return 0; } -static inline int device_init_wakeup(struct device *dev, bool val) +static inline int device_set_wakeup_enable(struct device *dev, bool enable) { - dev->power.can_wakeup = val; - return val ? -EINVAL : 0; + dev->power.should_wakeup = enable; + return 0; } +static inline int device_init_wakeup(struct device *dev, bool val) +{ + device_set_wakeup_capable(dev, val); + device_set_wakeup_enable(dev, val); + return 0; +} -static inline int device_set_wakeup_enable(struct device *dev, bool enable) +static inline bool device_may_wakeup(struct device *dev) { - return -EINVAL; + return dev->power.can_wakeup && dev->power.should_wakeup; } static inline void __pm_stay_awake(struct wakeup_source *ws) {} |