]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/suspend.h
Suspend-related patches for 2.6.27
[linux-2.6-omap-h63xx.git] / include / linux / suspend.h
index a6977423baf737ed67d4847cdce4c89fc24452e0..e8e69159af71c2ed546fb97f25316bcd5de1ea0f 100644 (file)
@@ -86,6 +86,11 @@ typedef int __bitwise suspend_state_t;
  *     that implement @begin(), but platforms implementing @begin() should
  *     also provide a @end() which cleans up transitions aborted before
  *     @enter().
+ *
+ * @recover: Recover the platform from a suspend failure.
+ *     Called by the PM core if the suspending of devices fails.
+ *     This callback is optional and should only be implemented by platforms
+ *     which require special recovery actions in that situation.
  */
 struct platform_suspend_ops {
        int (*valid)(suspend_state_t state);
@@ -94,6 +99,7 @@ struct platform_suspend_ops {
        int (*enter)(suspend_state_t state);
        void (*finish)(void);
        void (*end)(void);
+       void (*recover)(void);
 };
 
 #ifdef CONFIG_SUSPEND
@@ -149,7 +155,7 @@ extern void mark_free_pages(struct zone *zone);
  * The methods in this structure allow a platform to carry out special
  * operations required by it during a hibernation transition.
  *
- * All the methods below must be implemented.
+ * All the methods below, except for @recover(), must be implemented.
  *
  * @begin: Tell the platform driver that we're starting hibernation.
  *     Called right after shrinking memory and before freezing devices.
@@ -189,6 +195,11 @@ extern void mark_free_pages(struct zone *zone);
  * @restore_cleanup: Clean up after a failing image restoration.
  *     Called right after the nonboot CPUs have been enabled and before
  *     thawing devices (runs with IRQs on).
+ *
+ * @recover: Recover the platform from a failure to suspend devices.
+ *     Called by the PM core if the suspending of devices during hibernation
+ *     fails.  This callback is optional and should only be implemented by
+ *     platforms which require special recovery actions in that situation.
  */
 struct platform_hibernation_ops {
        int (*begin)(void);
@@ -200,6 +211,7 @@ struct platform_hibernation_ops {
        void (*leave)(void);
        int (*pre_restore)(void);
        void (*restore_cleanup)(void);
+       void (*recover)(void);
 };
 
 #ifdef CONFIG_HIBERNATION