diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-11-26 16:34:47 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2009-11-26 16:34:47 +1100 |
commit | e3fb63b2d663e3c73577dcb189bf51a3faf496d5 (patch) | |
tree | 895777a99bebe363fd00d8a1de255d1ea8237d96 /include | |
parent | 27d3035aac133b290eadc7493ca1960930c2e8e0 (diff) | |
parent | 3b3893a3f3fc821b7912769f0cfc8e73ec45329e (diff) |
Merge remote branch 'suspend/linux-next'
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 11 | ||||
-rw-r--r-- | include/linux/pm.h | 13 | ||||
-rw-r--r-- | include/linux/pm_link.h | 30 | ||||
-rw-r--r-- | include/linux/resume-trace.h | 7 |
4 files changed, 59 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 2ea3e4921812..71fbd582a265 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -472,6 +472,17 @@ static inline int device_is_registered(struct device *dev) return dev->kobj.state_in_sysfs; } +static inline void device_enable_async_suspend(struct device *dev, bool enable) +{ + if (dev->power.status == DPM_ON) + dev->power.async_suspend = enable; +} + +static inline bool device_async_suspend_enabled(struct device *dev) +{ + return !!dev->power.async_suspend; +} + void driver_init(void); /* diff --git a/include/linux/pm.h b/include/linux/pm.h index 3b7e04b95bd2..b305ebbd4ec4 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -26,6 +26,7 @@ #include <linux/spinlock.h> #include <linux/wait.h> #include <linux/timer.h> +#include <linux/completion.h> /* * Callbacks for platform drivers to implement. @@ -408,19 +409,24 @@ enum rpm_request { }; struct dev_pm_info { + spinlock_t lock; + wait_queue_head_t wait_queue; + struct list_head master_links; + struct list_head slave_links; pm_message_t power_state; unsigned int can_wakeup:1; unsigned int should_wakeup:1; + unsigned int async_suspend:1; enum dpm_state status; /* Owned by the PM core */ #ifdef CONFIG_PM_SLEEP struct list_head entry; + unsigned int op_started:1; + unsigned int op_complete:1; #endif #ifdef CONFIG_PM_RUNTIME struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; - wait_queue_head_t wait_queue; - spinlock_t lock; atomic_t usage_count; atomic_t child_count; unsigned int disable_depth:3; @@ -499,6 +505,9 @@ extern int sysdev_suspend(pm_message_t state); extern int dpm_suspend_noirq(pm_message_t state); extern int dpm_suspend_start(pm_message_t state); +struct timeval; +extern int pm_time_elapsed(struct timeval *start, struct timeval *stop); + extern void __suspend_report_result(const char *function, void *fn, int ret); #define suspend_report_result(fn, ret) \ diff --git a/include/linux/pm_link.h b/include/linux/pm_link.h new file mode 100644 index 000000000000..539f8e1ed62d --- /dev/null +++ b/include/linux/pm_link.h @@ -0,0 +1,30 @@ +/* + * include/linux/pm_link.h - PM links manipulation core. + * + * Copyright (c) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. + * + * This file is released under the GPLv2. + */ + +#ifndef _LINUX_PM_LINK_H +#define _LINUX_PM_LINK_H + +#include <linux/list.h> + +struct device; + +struct pm_link { + struct device *master; + struct list_head master_hook; + struct device *slave; + struct list_head slave_hook; +}; + +extern int pm_link_add(struct device *slave, struct device *master); +extern void pm_link_remove(struct device *dev, struct device *master); +extern int device_for_each_master(struct device *slave, void *data, + int (*fn)(struct device *dev, void *data)); +extern int device_for_each_slave(struct device *master, void *data, + int (*fn)(struct device *dev, void *data)); + +#endif diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h index c9ba2fdf807d..4860100e44f4 100644 --- a/include/linux/resume-trace.h +++ b/include/linux/resume-trace.h @@ -6,6 +6,11 @@ extern int pm_trace_enabled; +static inline int pm_trace_is_enabled(void) +{ + return pm_trace_enabled; +} + struct device; extern void set_trace_device(struct device *); extern void generate_resume_trace(const void *tracedata, unsigned int user); @@ -17,6 +22,8 @@ extern void generate_resume_trace(const void *tracedata, unsigned int user); #else +static inline int pm_trace_is_enabled(void) { return 0; } + #define TRACE_DEVICE(dev) do { } while (0) #define TRACE_RESUME(dev) do { } while (0) |