Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311465
b: refs/heads/master
c: febe53b
h: refs/heads/master
i:
  311463: c84651f
v: v3
  • Loading branch information
Lin Ming authored and Jeff Garzik committed Jun 29, 2012
1 parent 7a5e690 commit 24604e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 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: 30dcf76acc695cbd2fa919e294670fe9552e16e7
refs/heads/master: febe53ba6b781862c12686c7ea1972bdedee457a
20 changes: 11 additions & 9 deletions trunk/drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,23 +852,25 @@ void ata_acpi_on_resume(struct ata_port *ap)
void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
{
struct ata_device *dev;

if (!ata_ap_acpi_handle(ap) || (ap->flags & ATA_FLAG_ACPI_SATA))
return;
acpi_handle handle;

/* channel first and then drives for power on and vica versa
for power off */
if (state.event == PM_EVENT_ON)
acpi_bus_set_power(ata_ap_acpi_handle(ap), ACPI_STATE_D0);
handle = ata_ap_acpi_handle(ap);
if (handle && state.event == PM_EVENT_ON)
acpi_bus_set_power(handle, ACPI_STATE_D0);

ata_for_each_dev(dev, &ap->link, ENABLED) {
if (ata_dev_acpi_handle(dev))
acpi_bus_set_power(ata_dev_acpi_handle(dev),
handle = ata_dev_acpi_handle(dev);
if (handle)
acpi_bus_set_power(handle,
state.event == PM_EVENT_ON ?
ACPI_STATE_D0 : ACPI_STATE_D3);
}
if (state.event != PM_EVENT_ON)
acpi_bus_set_power(ata_ap_acpi_handle(ap), ACPI_STATE_D3);

handle = ata_ap_acpi_handle(ap);
if (handle && state.event != PM_EVENT_ON)
acpi_bus_set_power(handle, ACPI_STATE_D3);
}

/**
Expand Down

0 comments on commit 24604e5

Please sign in to comment.