Diffstat (limited to 'drivers/base/power/generic_ops.c')
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
index 96a92db83cad..07c3c4a9522d 100644
@@ -9,6 +9,7 @@
@@ -296,11 +297,27 @@ void pm_generic_complete(struct device *dev)
if (drv && drv->pm && drv->pm->complete)
+ * pm_complete_with_resume_check - Complete a device power transition.
+ * @dev: Device to handle.
+ * Complete a device power transition during a system-wide power transition and
+ * optionally schedule a runtime resume of the device if the system resume in
+ * progress has been initated by the platform firmware and the device had its
+ * power.direct_complete flag set.
+void pm_complete_with_resume_check(struct device *dev)
- * Let runtime PM try to suspend devices that haven't been in use before
- * going into the system-wide sleep state we're resuming from.
+ * If the device had been runtime-suspended before the system went into
+ * the sleep state it is going out of and it has never been resumed till
+ * now, resume it in case the firmware powered it up.
+ if (dev->power.direct_complete && pm_resume_via_firmware())
#endif /* CONFIG_PM_SLEEP */