Skip to content

Commit

Permalink
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
  PM: Make ACPI wakeup from S5 work again when CONFIG_PM_SLEEP is unset
  • Loading branch information
torvalds committed Feb 25, 2011
2 parents fe41947 + 805bdae commit 493f335
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ struct dev_pm_info {
struct list_head entry;
struct completion completion;
struct wakeup_source *wakeup;
#else
unsigned int should_wakeup:1;
#endif
#ifdef CONFIG_PM_RUNTIME
struct timer_list suspend_timer;
Expand Down
25 changes: 14 additions & 11 deletions include/linux/pm_wakeup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {}
Expand Down

0 comments on commit 493f335

Please sign in to comment.