Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172353
b: refs/heads/master
c: 7a1a8eb
h: refs/heads/master
i:
  172351: dbb3230
v: v3
  • Loading branch information
Rafael J. Wysocki committed Dec 6, 2009
1 parent 8f01735 commit fa506c0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 965c4ac0613b071d6f035334c5d9d942013df4f9
refs/heads/master: 7a1a8eb58a2c6cd819d17332c5a2c369203635d5
7 changes: 5 additions & 2 deletions trunk/Documentation/power/runtime_pm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ what to do to handle the device).
purpose).

In particular, if the driver requires remote wakeup capability for proper
functioning and device_may_wakeup() returns 'false' for the device, then
functioning and device_run_wake() returns 'false' for the device, then
->runtime_suspend() should return -EBUSY. On the other hand, if
device_may_wakeup() returns 'true' for the device and the device is put
device_run_wake() returns 'true' for the device and the device is put
into a low power state during the execution of its bus type's
->runtime_suspend(), it is expected that remote wake-up (i.e. hardware mechanism
allowing the device to request a change of its power state, such as PCI PME)
Expand Down Expand Up @@ -215,6 +215,9 @@ defined in include/linux/pm.h:
being executed for that device and it is not practical to wait for the
suspend to complete; means "start a resume as soon as you've suspended"

unsigned int run_wake;
- set if the device is capable of generating run-time wake-up events

enum rpm_status runtime_status;
- the run-time PM status of the device; this field's initial value is
RPM_SUSPENDED, which means that each device is initially regarded by the
Expand Down
8 changes: 5 additions & 3 deletions trunk/include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ typedef struct pm_message {
* This need not mean that the device should be put into a low power state.
* For example, if the device is behind a link which is about to be turned
* off, the device may remain at full power. If the device does go to low
* power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a
* hardware mechanism allowing the device to request a change of its power
* state, such as PCI PME) should be enabled for it.
* power and is capable of generating run-time wake-up events, remote
* wake-up (i.e., a hardware mechanism allowing the device to request a
* change of its power state via a wake-up event, such as PCI PME) should
* be enabled for it.
*
* @runtime_resume: Put the device into the fully active state in response to a
* wake-up event generated by hardware or at the request of software. If
Expand Down Expand Up @@ -428,6 +429,7 @@ struct dev_pm_info {
unsigned int idle_notification:1;
unsigned int request_pending:1;
unsigned int deferred_resume:1;
unsigned int run_wake:1;
enum rpm_request request;
enum rpm_status runtime_status;
int runtime_error;
Expand Down
12 changes: 12 additions & 0 deletions trunk/include/linux/pm_runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev)
atomic_add_unless(&dev->power.usage_count, -1, 0);
}

static inline bool device_run_wake(struct device *dev)
{
return dev->power.run_wake;
}

static inline void device_set_run_wake(struct device *dev, bool enable)
{
dev->power.run_wake = enable;
}

#else /* !CONFIG_PM_RUNTIME */

static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; }
Expand All @@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; }
static inline void pm_suspend_ignore_children(struct device *dev, bool en) {}
static inline void pm_runtime_get_noresume(struct device *dev) {}
static inline void pm_runtime_put_noidle(struct device *dev) {}
static inline bool device_run_wake(struct device *dev) { return false; }
static inline void device_set_run_wake(struct device *dev, bool enable) {}

#endif /* !CONFIG_PM_RUNTIME */

Expand Down

0 comments on commit fa506c0

Please sign in to comment.