Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328660
b: refs/heads/master
c: bed2b42
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Sep 3, 2012
1 parent 6596077 commit fb8ae57
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 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: e91c11b1a7f876c6f056d872eb210734150a1795
refs/heads/master: bed2b42d9f0b411f384c5619870ab0fea5dd116b
2 changes: 2 additions & 0 deletions trunk/drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/pm_runtime.h>

#include "base.h"
#include "power/power.h"

#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \
driver))
Expand Down Expand Up @@ -948,6 +949,7 @@ void __init early_platform_add_devices(struct platform_device **devs, int num)
dev = &devs[i]->dev;

if (!dev->devres_head.next) {
pm_runtime_early_init(dev);
INIT_LIST_HEAD(&dev->devres_head);
list_add_tail(&dev->devres_head,
&early_platform_device_list);
Expand Down
18 changes: 16 additions & 2 deletions trunk/drivers/base/power/power.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@

static inline void device_pm_init_common(struct device *dev)
{
spin_lock_init(&dev->power.lock);
dev->power.power_state = PMSG_INVALID;
if (!dev->power.early_init) {
spin_lock_init(&dev->power.lock);
dev->power.power_state = PMSG_INVALID;
dev->power.early_init = true;
}
}

#ifdef CONFIG_PM_RUNTIME

static inline void pm_runtime_early_init(struct device *dev)
{
dev->power.disable_depth = 1;
device_pm_init_common(dev);
}

extern void pm_runtime_init(struct device *dev);
extern void pm_runtime_remove(struct device *dev);

#else /* !CONFIG_PM_RUNTIME */

static inline void pm_runtime_early_init(struct device *dev)
{
device_pm_init_common(dev);
}

static inline void pm_runtime_init(struct device *dev) {}
static inline void pm_runtime_remove(struct device *dev) {}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ struct dev_pm_info {
bool is_prepared:1; /* Owned by the PM core */
bool is_suspended:1; /* Ditto */
bool ignore_children:1;
bool early_init:1; /* Owned by the PM core */
spinlock_t lock;
#ifdef CONFIG_PM_SLEEP
struct list_head entry;
Expand Down

0 comments on commit fb8ae57

Please sign in to comment.