diff options
author | David Shaohua Li <shaohua.li@intel.com> | 2005-03-19 00:16:18 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-11 23:47:06 -0400 |
commit | b913100d7304ea9596d8d85ab5f3ae04bd2b0ddb (patch) | |
tree | 270925a02dd83264fd5bd3a47fc39453798c39d5 /drivers/pci/pci-acpi.c | |
parent | 0f64474b8f7f1f7f3af5b24ef997baa35f923509 (diff) |
[ACPI] pci_set_power_state() now calls
platform_pci_set_power_state()
and ACPI can answer
http://bugzilla.kernel.org/show_bug.cgi?id=4277
Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r-- | drivers/pci/pci-acpi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 8eb599708de..a0d43ea872d 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -253,6 +253,24 @@ static int acpi_pci_choose_state(struct pci_dev *pdev, pm_message_t state) | |||
253 | return -ENODEV; | 253 | return -ENODEV; |
254 | } | 254 | } |
255 | 255 | ||
256 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | ||
257 | { | ||
258 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); | ||
259 | static int state_conv[] = { | ||
260 | [0] = 0, | ||
261 | [1] = 1, | ||
262 | [2] = 2, | ||
263 | [3] = 3, | ||
264 | [4] = 3 | ||
265 | }; | ||
266 | int acpi_state = state_conv[(int __force) state]; | ||
267 | |||
268 | if (!handle) | ||
269 | return -ENODEV; | ||
270 | return acpi_bus_set_power(handle, acpi_state); | ||
271 | } | ||
272 | |||
273 | |||
256 | /* ACPI bus type */ | 274 | /* ACPI bus type */ |
257 | static int pci_acpi_find_device(struct device *dev, acpi_handle *handle) | 275 | static int pci_acpi_find_device(struct device *dev, acpi_handle *handle) |
258 | { | 276 | { |
@@ -300,6 +318,7 @@ static int __init pci_acpi_init(void) | |||
300 | if (ret) | 318 | if (ret) |
301 | return 0; | 319 | return 0; |
302 | platform_pci_choose_state = acpi_pci_choose_state; | 320 | platform_pci_choose_state = acpi_pci_choose_state; |
321 | platform_pci_set_power_state = acpi_pci_set_power_state; | ||
303 | return 0; | 322 | return 0; |
304 | } | 323 | } |
305 | arch_initcall(pci_acpi_init); | 324 | arch_initcall(pci_acpi_init); |