diff options
author | Shaohua Li <shaohua.li@intel.com> | 2007-07-20 10:03:20 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-07-22 04:18:20 -0400 |
commit | fc30e68e88baf463683bde43347756889ba2ffae (patch) | |
tree | 3da69f1c11c10e0ad3c3663989575a5a03ef61c1 /drivers/pnp/pnpacpi | |
parent | fd4aff1a28eecbd729b409bf7d3eff5948f20414 (diff) | |
download | kernel_samsung_smdk4412-fc30e68e88baf463683bde43347756889ba2ffae.zip kernel_samsung_smdk4412-fc30e68e88baf463683bde43347756889ba2ffae.tar.gz kernel_samsung_smdk4412-fc30e68e88baf463683bde43347756889ba2ffae.tar.bz2 |
ACPI, PNP: hook ACPI D-state to PNP suspend/resume
applied after Rafel's 'PM: Update global suspend and hibernation operations framework' patch set
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/pnpacpi')
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index a005487..c37a558 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -119,11 +119,25 @@ static int pnpacpi_disable_resources(struct pnp_dev *dev) return ACPI_FAILURE(status) ? -ENODEV : 0; } +static int pnpacpi_suspend(struct pnp_dev *dev, pm_message_t state) +{ + return acpi_bus_set_power((acpi_handle)dev->data, + acpi_pm_device_sleep_state(&dev->dev, + device_may_wakeup(&dev->dev), NULL)); +} + +static int pnpacpi_resume(struct pnp_dev *dev) +{ + return acpi_bus_set_power((acpi_handle)dev->data, ACPI_STATE_D0); +} + static struct pnp_protocol pnpacpi_protocol = { .name = "Plug and Play ACPI", .get = pnpacpi_get_resources, .set = pnpacpi_set_resources, .disable = pnpacpi_disable_resources, + .suspend = pnpacpi_suspend, + .resume = pnpacpi_resume, }; static int __init pnpacpi_add_device(struct acpi_device *device) |