aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2012-11-06 19:57:59 -0500
committerBjorn Helgaas <bhelgaas@google.com>2012-11-13 13:49:36 -0500
commit71fbad6c9a28629b6af40b0ff48f36c6610a1394 (patch)
tree5c520581937e9f4257afa67d13c49dce626a7461 /drivers
parenteba48cd0f05ff7a2f82291feae169c14b61b29af (diff)
PCI/ACPI: Notify PCI devices when their power resource is turned on
This patch reduces power consumption by allowing idle devices to go to a low power state after another device on the same power resource has been awakened. A power resource may be shared by multiple devices. When all devices sharing a power resource are put into D3_COLD state, the power resource will be turned off. When one of the devices is awakened, the power resource will be turned on and all devices sharing it will be powered on to D0uninitialized state. These devices should be resumed, so that they have the opportunity to go to low power state later. [bhelgaas: changelog] Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/pci_bind.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 2ef04098cc1d..f1ea71c80ab6 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -45,6 +45,7 @@ static int acpi_pci_unbind(struct acpi_device *device)
45 45
46 device_set_run_wake(&dev->dev, false); 46 device_set_run_wake(&dev->dev, false);
47 pci_acpi_remove_pm_notifier(device); 47 pci_acpi_remove_pm_notifier(device);
48 acpi_power_resource_unregister_device(&dev->dev, device->handle);
48 49
49 if (!dev->subordinate) 50 if (!dev->subordinate)
50 goto out; 51 goto out;
@@ -71,6 +72,7 @@ static int acpi_pci_bind(struct acpi_device *device)
71 return 0; 72 return 0;
72 73
73 pci_acpi_add_pm_notifier(device, dev); 74 pci_acpi_add_pm_notifier(device, dev);
75 acpi_power_resource_register_device(&dev->dev, device->handle);
74 if (device->wakeup.flags.run_wake) 76 if (device->wakeup.flags.run_wake)
75 device_set_run_wake(&dev->dev, true); 77 device_set_run_wake(&dev->dev, true);
76 78