Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[pandora-kernel.git] / include / linux / suspend.h
index a697742..e8e6915 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