@@ -40,6 +40,7 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/slab.h>
+#include <linux/pm_runtime.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include "sleep.h"
@@ -201,6 +202,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
static int __acpi_power_on(struct acpi_power_resource *resource)
{
acpi_status status = AE_OK;
+ struct acpi_powered_device *apd;
status = acpi_evaluate_object(resource->device->handle, "_ON", NULL, NULL);
if (ACPI_FAILURE(status))
@@ -212,6 +214,13 @@ static int __acpi_power_on(struct acpi_power_resource *resource)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
resource->name));
+ /* resume all the devices when power resource is turned on */
+ list_for_each_entry(apd, &resource->devices, node){
+ pm_request_resume(apd->dev);
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "resume device %s\n",
+ apd->dev->kobj.name));
+ }
+
return 0;
}