diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 21db05ac7c0b..9bd86db4d395 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -166,6 +166,24 @@ extern struct pm_ops *pm_ops; | |||
166 | extern int pm_suspend(suspend_state_t state); | 166 | extern int pm_suspend(suspend_state_t state); |
167 | 167 | ||
168 | 168 | ||
169 | /** | ||
170 | * arch_suspend_disable_irqs - disable IRQs for suspend | ||
171 | * | ||
172 | * Disables IRQs (in the default case). This is a weak symbol in the common | ||
173 | * code and thus allows architectures to override it if more needs to be | ||
174 | * done. Not called for suspend to disk. | ||
175 | */ | ||
176 | extern void arch_suspend_disable_irqs(void); | ||
177 | |||
178 | /** | ||
179 | * arch_suspend_enable_irqs - enable IRQs after suspend | ||
180 | * | ||
181 | * Enables IRQs (in the default case). This is a weak symbol in the common | ||
182 | * code and thus allows architectures to override it if more needs to be | ||
183 | * done. Not called for suspend to disk. | ||
184 | */ | ||
185 | extern void arch_suspend_enable_irqs(void); | ||
186 | |||
169 | /* | 187 | /* |
170 | * Device power management | 188 | * Device power management |
171 | */ | 189 | */ |
@@ -273,6 +291,20 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
273 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 291 | __suspend_report_result(__FUNCTION__, fn, ret); \ |
274 | } while (0) | 292 | } while (0) |
275 | 293 | ||
294 | /* | ||
295 | * Platform hook to activate device wakeup capability, if that's not already | ||
296 | * handled by enable_irq_wake() etc. | ||
297 | * Returns zero on success, else negative errno | ||
298 | */ | ||
299 | extern int (*platform_enable_wakeup)(struct device *dev, int is_on); | ||
300 | |||
301 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
302 | { | ||
303 | if (platform_enable_wakeup) | ||
304 | return (*platform_enable_wakeup)(dev, is_on); | ||
305 | return 0; | ||
306 | } | ||
307 | |||
276 | #else /* !CONFIG_PM */ | 308 | #else /* !CONFIG_PM */ |
277 | 309 | ||
278 | static inline int device_suspend(pm_message_t state) | 310 | static inline int device_suspend(pm_message_t state) |
@@ -294,6 +326,11 @@ static inline void dpm_runtime_resume(struct device * dev) | |||
294 | 326 | ||
295 | #define suspend_report_result(fn, ret) do { } while (0) | 327 | #define suspend_report_result(fn, ret) do { } while (0) |
296 | 328 | ||
329 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
330 | { | ||
331 | return -EIO; | ||
332 | } | ||
333 | |||
297 | #endif | 334 | #endif |
298 | 335 | ||
299 | /* changes to device_may_wakeup take effect on the next pm state change. | 336 | /* changes to device_may_wakeup take effect on the next pm state change. |