aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2012-06-22 22:23:48 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-06-23 12:41:09 -0400
commitee85f543710dd56ce526cb44e39191f32972e5ad (patch)
tree13009358f0260d39c106b6708d6bb49f1d73279f /include/acpi
parentcfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff)
ACPI/PM: specify lowest allowed state for device sleep state
Lower device sleep state can save more power, but has more exit latency too. Sometimes, to satisfy some power QoS and other requirement, we need to constrain the lowest device sleep state. In this patch, a parameter to specify lowest allowed state for acpi_pm_device_sleep_state is added. So that the caller can enforce the constraint via the parameter. This is needed by PCIe D3cold support, where the lowest power state allowed may be D3_HOT instead of default D3_COLD. CC: Len Brown <lenb@kernel.org> CC: linux-acpi@vger.kernel.org Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 9e6e1c6eb60a..16bd68504ff7 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -414,13 +414,13 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
414int acpi_disable_wakeup_device_power(struct acpi_device *dev); 414int acpi_disable_wakeup_device_power(struct acpi_device *dev);
415 415
416#ifdef CONFIG_PM 416#ifdef CONFIG_PM
417int acpi_pm_device_sleep_state(struct device *, int *); 417int acpi_pm_device_sleep_state(struct device *, int *, int);
418#else 418#else
419static inline int acpi_pm_device_sleep_state(struct device *d, int *p) 419static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
420{ 420{
421 if (p) 421 if (p)
422 *p = ACPI_STATE_D0; 422 *p = ACPI_STATE_D0;
423 return ACPI_STATE_D3; 423 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
424} 424}
425#endif 425#endif
426 426