Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350924
b: refs/heads/master
c: ff0c419
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 17, 2013
1 parent c019c79 commit 44ea363
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0596a52b8357b25185e06af32973225baeb7196a
refs/heads/master: ff0c41942fd9766a158502d8ed6965c8a7726f53
12 changes: 10 additions & 2 deletions trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ int acpi_device_set_power(struct acpi_device *device, int state)
int result = 0;
acpi_status status = AE_OK;
char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
bool cut_power = false;

if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD))
return -EINVAL;
Expand All @@ -294,9 +295,13 @@ int acpi_device_set_power(struct acpi_device *device, int state)
return -ENODEV;
}

/* For D3cold we should execute _PS3, not _PS4. */
if (state == ACPI_STATE_D3_COLD)
/* For D3cold we should first transition into D3hot. */
if (state == ACPI_STATE_D3_COLD
&& device->power.states[ACPI_STATE_D3_COLD].flags.os_accessible) {
state = ACPI_STATE_D3_HOT;
object_name[3] = '3';
cut_power = true;
}

/*
* Transition Power
Expand Down Expand Up @@ -341,6 +346,9 @@ int acpi_device_set_power(struct acpi_device *device, int state)
}
}

if (cut_power)
result = acpi_power_transition(device, ACPI_STATE_D3_COLD);

end:
if (result)
printk(KERN_WARNING PREFIX
Expand Down

0 comments on commit 44ea363

Please sign in to comment.