@@ -181,6 +181,13 @@ static int pm_op(struct device *dev,
suspend_report_result(ops->suspend, error);
}
break;
+ case PM_EVENT_CANCEL:
+ if (ops->cancel) {
+ error = ops->cancel(dev);
+ suspend_report_result(ops->cancel, error);
+ break;
+ }
+ /* Fall through */
case PM_EVENT_RESUME:
if (ops->resume) {
error = ops->resume(dev);
@@ -293,6 +300,8 @@ static char *pm_verb(int event)
return "suspend";
case PM_EVENT_RESUME:
return "resume";
+ case PM_EVENT_CANCEL:
+ return "cancel";
case PM_EVENT_FREEZE:
return "freeze";
case PM_EVENT_QUIESCE:
@@ -198,6 +198,7 @@ struct dev_pm_ops {
void (*complete)(struct device *dev);
int (*suspend)(struct device *dev);
int (*resume)(struct device *dev);
+ int (*cancel)(struct device *dev);
int (*freeze)(struct device *dev);
int (*thaw)(struct device *dev);
int (*poweroff)(struct device *dev);
@@ -291,6 +292,7 @@ struct dev_pm_ops name = { \
#define PM_EVENT_USER 0x0100
#define PM_EVENT_REMOTE 0x0200
#define PM_EVENT_AUTO 0x0400
+#define PM_EVENT_CANCEL 0x0800
#define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE)
#define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND)
@@ -308,6 +310,7 @@ struct dev_pm_ops name = { \
#define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, })
#define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, })
#define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, })
+#define PMSG_CANCEL ((struct pm_message){ .event = PM_EVENT_CANCEL, })
#define PMSG_USER_SUSPEND ((struct pm_message) \
{ .event = PM_EVENT_USER_SUSPEND, })
#define PMSG_USER_RESUME ((struct pm_message) \