diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-25 14:28:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-25 14:28:00 -0400 |
commit | a4fb2122f1fc4a22bd6a5b8a195b952c2d31c54d (patch) | |
tree | db24e2160fe8eb8d787ad67bd3e08d3284806330 /drivers/pci/pci-acpi.c | |
parent | bc72450aebe73587f80bbae8fc0b62c3d81b85fe (diff) | |
parent | 323ef30af3a0da47cc761b04b262d98d0fe79126 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI: Kconfig: remove CONFIG_ACPI_SLEEP from source
ACPI: quiet ACPI Exceptions due to no _PTC or _TSS
ACPI: Remove references to ACPI_STATE_S2 from acpi_pm_enter
ACPI: Kconfig: always enable CONFIG_ACPI_SLEEP on X86
ACPI: Kconfig: fold /proc/acpi/sleep under CONFIG_ACPI_PROCFS
ACPI: Kconfig: CONFIG_ACPI_PROCFS now defaults to N
ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers
ACPI: autoload modules - Create ACPI alias interface
ACPI: autoload modules - ACPICA modifications
ACPI: asus-laptop: Fix failure exits
ACPI: fix oops due to typo in new throttling code
ACPI: ignore _PSx method for hotplugable PCI devices
ACPI: Use ACPI methods to select PCI device suspend state
ACPI, PNP: hook ACPI D-state to PNP suspend/resume
ACPI: Add acpi_pm_device_sleep_state helper routine
ACPI: Implement the set_target() callback from pm_ops
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r-- | drivers/pci/pci-acpi.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index c8062494009f..67c63d1f1582 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -245,16 +245,33 @@ EXPORT_SYMBOL(pci_osc_control_set); | |||
245 | * currently we simply return _SxD, if present. | 245 | * currently we simply return _SxD, if present. |
246 | */ | 246 | */ |
247 | 247 | ||
248 | static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state) | 248 | static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev, |
249 | pm_message_t state) | ||
249 | { | 250 | { |
250 | /* TBD */ | 251 | int acpi_state; |
251 | 252 | ||
252 | return -ENODEV; | 253 | acpi_state = acpi_pm_device_sleep_state(&pdev->dev, |
254 | device_may_wakeup(&pdev->dev), NULL); | ||
255 | if (acpi_state < 0) | ||
256 | return PCI_POWER_ERROR; | ||
257 | |||
258 | switch (acpi_state) { | ||
259 | case ACPI_STATE_D0: | ||
260 | return PCI_D0; | ||
261 | case ACPI_STATE_D1: | ||
262 | return PCI_D1; | ||
263 | case ACPI_STATE_D2: | ||
264 | return PCI_D2; | ||
265 | case ACPI_STATE_D3: | ||
266 | return PCI_D3hot; | ||
267 | } | ||
268 | return PCI_POWER_ERROR; | ||
253 | } | 269 | } |
254 | 270 | ||
255 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 271 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
256 | { | 272 | { |
257 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); | 273 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); |
274 | acpi_handle tmp; | ||
258 | static int state_conv[] = { | 275 | static int state_conv[] = { |
259 | [0] = 0, | 276 | [0] = 0, |
260 | [1] = 1, | 277 | [1] = 1, |
@@ -266,6 +283,9 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
266 | 283 | ||
267 | if (!handle) | 284 | if (!handle) |
268 | return -ENODEV; | 285 | return -ENODEV; |
286 | /* If the ACPI device has _EJ0, ignore the device */ | ||
287 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) | ||
288 | return 0; | ||
269 | return acpi_bus_set_power(handle, acpi_state); | 289 | return acpi_bus_set_power(handle, acpi_state); |
270 | } | 290 | } |
271 | 291 | ||