libata-acpi: set acpi state for SATA port
Currently, ata_acpi_set_state() only sets acpi sate for IDE port. Remove this limitation. Acked-by: Aaron Lu <aaron.lu@amd.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
Родитель
30dcf76acc
Коммит
febe53ba6b
|
@ -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)
|
void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
|
||||||
{
|
{
|
||||||
struct ata_device *dev;
|
struct ata_device *dev;
|
||||||
|
acpi_handle handle;
|
||||||
if (!ata_ap_acpi_handle(ap) || (ap->flags & ATA_FLAG_ACPI_SATA))
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* channel first and then drives for power on and vica versa
|
/* channel first and then drives for power on and vica versa
|
||||||
for power off */
|
for power off */
|
||||||
if (state.event == PM_EVENT_ON)
|
handle = ata_ap_acpi_handle(ap);
|
||||||
acpi_bus_set_power(ata_ap_acpi_handle(ap), ACPI_STATE_D0);
|
if (handle && state.event == PM_EVENT_ON)
|
||||||
|
acpi_bus_set_power(handle, ACPI_STATE_D0);
|
||||||
|
|
||||||
ata_for_each_dev(dev, &ap->link, ENABLED) {
|
ata_for_each_dev(dev, &ap->link, ENABLED) {
|
||||||
if (ata_dev_acpi_handle(dev))
|
handle = ata_dev_acpi_handle(dev);
|
||||||
acpi_bus_set_power(ata_dev_acpi_handle(dev),
|
if (handle)
|
||||||
|
acpi_bus_set_power(handle,
|
||||||
state.event == PM_EVENT_ON ?
|
state.event == PM_EVENT_ON ?
|
||||||
ACPI_STATE_D0 : ACPI_STATE_D3);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче