aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-03-19 17:37:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-19 22:10:25 -0400
commitd288e47c471e1090e80c62ad95882fafbf3f499d (patch)
treebfc8a880b49a0b7a0bb200ae0f0462f5523d0256 /include/linux
parent74081f8667d73ad59961cf63be5f0e9d6a87c8a3 (diff)
PM: Make wakeup flags available whenever CONFIG_PM is set
The various wakeup flags and their accessor macros in struct dev_pm_info should be available whenever CONFIG_PM is enabled, not just when CONFIG_PM_SLEEP is on. Otherwise remote wakeup won't always be configurable for runtime power management. This patch (as1056b) fixes the oversight. David Brownell adds: More accurately, fixes the "regression" ... as noted sometime last summer, after 296699de6bdc717189a331ab6bbe90e05c94db06 introduced CONFIG_SUSPEND. But that didn't make the regression list for that kernel, ergo the delay in fixing it. [rjw: rebased] Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pm.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index e6b9f29e27d7..3342627e2bd6 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -183,9 +183,9 @@ typedef struct pm_message {
183struct dev_pm_info { 183struct 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 unsigned should_wakeup:1;
186 bool sleeping:1; /* Owned by the PM core */ 187 bool sleeping:1; /* Owned by the PM core */
187#ifdef CONFIG_PM_SLEEP 188#ifdef CONFIG_PM_SLEEP
188 unsigned should_wakeup:1;
189 struct list_head entry; 189 struct list_head entry;
190#endif 190#endif
191}; 191};
@@ -198,11 +198,6 @@ extern void device_resume(void);
198extern int device_suspend(pm_message_t state); 198extern int device_suspend(pm_message_t state);
199extern int device_prepare_suspend(pm_message_t state); 199extern int device_prepare_suspend(pm_message_t state);
200 200
201#define device_set_wakeup_enable(dev,val) \
202 ((dev)->power.should_wakeup = !!(val))
203#define device_may_wakeup(dev) \
204 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
205
206extern void __suspend_report_result(const char *function, void *fn, int ret); 201extern void __suspend_report_result(const char *function, void *fn, int ret);
207 202
208#define suspend_report_result(fn, ret) \ 203#define suspend_report_result(fn, ret) \
@@ -210,6 +205,24 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
210 __suspend_report_result(__FUNCTION__, fn, ret); \ 205 __suspend_report_result(__FUNCTION__, fn, ret); \
211 } while (0) 206 } while (0)
212 207
208#else /* !CONFIG_PM_SLEEP */
209
210static inline int device_suspend(pm_message_t state)
211{
212 return 0;
213}
214
215#define suspend_report_result(fn, ret) do { } while (0)
216
217#endif /* !CONFIG_PM_SLEEP */
218
219#ifdef CONFIG_PM
220
221#define device_set_wakeup_enable(dev,val) \
222 ((dev)->power.should_wakeup = !!(val))
223#define device_may_wakeup(dev) \
224 (device_can_wakeup(dev) && (dev)->power.should_wakeup)
225
213/* 226/*
214 * Platform hook to activate device wakeup capability, if that's not already 227 * Platform hook to activate device wakeup capability, if that's not already
215 * handled by enable_irq_wake() etc. 228 * handled by enable_irq_wake() etc.
@@ -224,24 +237,17 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
224 return 0; 237 return 0;
225} 238}
226 239
227#else /* !CONFIG_PM_SLEEP */ 240#else /* !CONFIG_PM */
228
229static inline int device_suspend(pm_message_t state)
230{
231 return 0;
232}
233 241
234#define device_set_wakeup_enable(dev,val) do{}while(0) 242#define device_set_wakeup_enable(dev,val) do{}while(0)
235#define device_may_wakeup(dev) (0) 243#define device_may_wakeup(dev) (0)
236 244
237#define suspend_report_result(fn, ret) do { } while (0)
238
239static inline int call_platform_enable_wakeup(struct device *dev, int is_on) 245static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
240{ 246{
241 return 0; 247 return 0;
242} 248}
243 249
244#endif /* !CONFIG_PM_SLEEP */ 250#endif /* !CONFIG_PM */
245 251
246/* changes to device_may_wakeup take effect on the next pm state change. 252/* changes to device_may_wakeup take effect on the next pm state change.
247 * by default, devices should wakeup if they can. 253 * by default, devices should wakeup if they can.