diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:49:58 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-21 18:49:58 -0400 |
| commit | e80ab411e589e00550e2e6e5a6a02d59cc730357 (patch) | |
| tree | 870225ff7b5b8d03e82a996963213a4bb9cce248 /include/linux/pm.h | |
| parent | 529a41e36673b518c9e091f3a8d932b6b9e3c461 (diff) | |
| parent | ee959b00c335d7780136c5abda37809191fe52c3 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits)
SCSI: convert struct class_device to struct device
DRM: remove unused dev_class
IB: rename "dev" to "srp_dev" in srp_host structure
IB: convert struct class_device to struct device
memstick: convert struct class_device to struct device
driver core: replace remaining __FUNCTION__ occurrences
sysfs: refill attribute buffer when reading from offset 0
PM: Remove destroy_suspended_device()
Firmware: add iSCSI iBFT Support
PM: Remove legacy PM (fix)
Kobject: Replace list_for_each() with list_for_each_entry().
SYSFS: Explicitly include required header file slab.h.
Driver core: make device_is_registered() work for class devices
PM: Convert wakeup flag accessors to inline functions
PM: Make wakeup flags available whenever CONFIG_PM is set
PM: Fix misuse of wakeup flag accessors in serial core
Driver core: Call device_pm_add() after bus_add_device() in device_add()
PM: Handle device registrations during suspend/resume
block: send disk "change" event for rescan_partitions()
sysdev: detect multiple driver registrations
...
Fixed trivial conflict in include/linux/memory.h due to semaphore header
file change (made irrelevant by the change to mutex).
Diffstat (limited to 'include/linux/pm.h')
| -rw-r--r-- | include/linux/pm.h | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 015b735811b4..1de72cbbe0d1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -183,8 +183,9 @@ typedef struct pm_message { | |||
| 183 | struct dev_pm_info { | 183 | struct dev_pm_info { |
| 184 | pm_message_t power_state; | 184 | pm_message_t power_state; |
| 185 | unsigned can_wakeup:1; | 185 | unsigned can_wakeup:1; |
| 186 | #ifdef CONFIG_PM_SLEEP | ||
| 187 | unsigned should_wakeup:1; | 186 | unsigned should_wakeup:1; |
| 187 | bool sleeping:1; /* Owned by the PM core */ | ||
| 188 | #ifdef CONFIG_PM_SLEEP | ||
| 188 | struct list_head entry; | 189 | struct list_head entry; |
| 189 | #endif | 190 | #endif |
| 190 | }; | 191 | }; |
| @@ -197,11 +198,6 @@ extern void device_resume(void); | |||
| 197 | extern int device_suspend(pm_message_t state); | 198 | extern int device_suspend(pm_message_t state); |
| 198 | extern int device_prepare_suspend(pm_message_t state); | 199 | extern int device_prepare_suspend(pm_message_t state); |
| 199 | 200 | ||
| 200 | #define device_set_wakeup_enable(dev,val) \ | ||
| 201 | ((dev)->power.should_wakeup = !!(val)) | ||
| 202 | #define device_may_wakeup(dev) \ | ||
| 203 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
| 204 | |||
| 205 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 201 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
| 206 | 202 | ||
| 207 | #define suspend_report_result(fn, ret) \ | 203 | #define suspend_report_result(fn, ret) \ |
| @@ -209,20 +205,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
| 209 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 205 | __suspend_report_result(__FUNCTION__, fn, ret); \ |
| 210 | } while (0) | 206 | } while (0) |
| 211 | 207 | ||
| 212 | /* | ||
| 213 | * Platform hook to activate device wakeup capability, if that's not already | ||
| 214 | * handled by enable_irq_wake() etc. | ||
| 215 | * Returns zero on success, else negative errno | ||
| 216 | */ | ||
| 217 | extern int (*platform_enable_wakeup)(struct device *dev, int is_on); | ||
| 218 | |||
| 219 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
| 220 | { | ||
| 221 | if (platform_enable_wakeup) | ||
| 222 | return (*platform_enable_wakeup)(dev, is_on); | ||
| 223 | return 0; | ||
| 224 | } | ||
| 225 | |||
| 226 | #else /* !CONFIG_PM_SLEEP */ | 208 | #else /* !CONFIG_PM_SLEEP */ |
| 227 | 209 | ||
| 228 | static inline int device_suspend(pm_message_t state) | 210 | static inline int device_suspend(pm_message_t state) |
| @@ -230,29 +212,10 @@ static inline int device_suspend(pm_message_t state) | |||
| 230 | return 0; | 212 | return 0; |
| 231 | } | 213 | } |
| 232 | 214 | ||
| 233 | #define device_set_wakeup_enable(dev,val) do{}while(0) | 215 | #define suspend_report_result(fn, ret) do {} while (0) |
| 234 | #define device_may_wakeup(dev) (0) | ||
| 235 | |||
| 236 | #define suspend_report_result(fn, ret) do { } while (0) | ||
| 237 | |||
| 238 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
| 239 | { | ||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | 216 | ||
| 243 | #endif /* !CONFIG_PM_SLEEP */ | 217 | #endif /* !CONFIG_PM_SLEEP */ |
| 244 | 218 | ||
| 245 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
| 246 | * by default, devices should wakeup if they can. | ||
| 247 | */ | ||
| 248 | #define device_can_wakeup(dev) \ | ||
| 249 | ((dev)->power.can_wakeup) | ||
| 250 | #define device_init_wakeup(dev,val) \ | ||
| 251 | do { \ | ||
| 252 | device_can_wakeup(dev) = !!(val); \ | ||
| 253 | device_set_wakeup_enable(dev,val); \ | ||
| 254 | } while(0) | ||
| 255 | |||
| 256 | /* | 219 | /* |
| 257 | * Global Power Management flags | 220 | * Global Power Management flags |
| 258 | * Used to keep APM and ACPI from both being active | 221 | * Used to keep APM and ACPI from both being active |
