aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 4754ff6e70e6..721d93b3ceee 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -25,7 +25,9 @@
25#include "internal.h" 25#include "internal.h"
26#include "sleep.h" 26#include "sleep.h"
27 27
28u8 sleep_states[ACPI_S_STATE_COUNT]; 28static u8 sleep_states[ACPI_S_STATE_COUNT];
29
30static u32 acpi_target_sleep_state = ACPI_STATE_S0;
29 31
30static void acpi_sleep_tts_switch(u32 acpi_state) 32static void acpi_sleep_tts_switch(u32 acpi_state)
31{ 33{
@@ -79,8 +81,6 @@ static int acpi_sleep_prepare(u32 acpi_state)
79} 81}
80 82
81#ifdef CONFIG_ACPI_SLEEP 83#ifdef CONFIG_ACPI_SLEEP
82static u32 acpi_target_sleep_state = ACPI_STATE_S0;
83
84/* 84/*
85 * The ACPI specification wants us to save NVS memory regions during hibernation 85 * The ACPI specification wants us to save NVS memory regions during hibernation
86 * and to restore them during the subsequent resume. Windows does that also for 86 * and to restore them during the subsequent resume. Windows does that also for
@@ -419,6 +419,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
419 DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"), 419 DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
420 }, 420 },
421 }, 421 },
422 {
423 .callback = init_nvs_nosave,
424 .ident = "Sony Vaio VPCEB1Z1E",
425 .matches = {
426 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
427 DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
428 },
429 },
422 {}, 430 {},
423}; 431};
424#endif /* CONFIG_SUSPEND */ 432#endif /* CONFIG_SUSPEND */
@@ -562,7 +570,7 @@ int acpi_suspend(u32 acpi_state)
562 return -EINVAL; 570 return -EINVAL;
563} 571}
564 572
565#ifdef CONFIG_PM_SLEEP 573#ifdef CONFIG_PM_OPS
566/** 574/**
567 * acpi_pm_device_sleep_state - return preferred power state of ACPI device 575 * acpi_pm_device_sleep_state - return preferred power state of ACPI device
568 * in the system sleep state given by %acpi_target_sleep_state 576 * in the system sleep state given by %acpi_target_sleep_state
@@ -624,7 +632,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
624 * can wake the system. _S0W may be valid, too. 632 * can wake the system. _S0W may be valid, too.
625 */ 633 */
626 if (acpi_target_sleep_state == ACPI_STATE_S0 || 634 if (acpi_target_sleep_state == ACPI_STATE_S0 ||
627 (device_may_wakeup(dev) && adev->wakeup.state.enabled && 635 (device_may_wakeup(dev) &&
628 adev->wakeup.sleep_state <= acpi_target_sleep_state)) { 636 adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
629 acpi_status status; 637 acpi_status status;
630 638
@@ -632,7 +640,9 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
632 status = acpi_evaluate_integer(handle, acpi_method, NULL, 640 status = acpi_evaluate_integer(handle, acpi_method, NULL,
633 &d_max); 641 &d_max);
634 if (ACPI_FAILURE(status)) { 642 if (ACPI_FAILURE(status)) {
635 d_max = d_min; 643 if (acpi_target_sleep_state != ACPI_STATE_S0 ||
644 status != AE_NOT_FOUND)
645 d_max = d_min;
636 } else if (d_max < d_min) { 646 } else if (d_max < d_min) {
637 /* Warn the user of the broken DSDT */ 647 /* Warn the user of the broken DSDT */
638 printk(KERN_WARNING "ACPI: Wrong value from %s\n", 648 printk(KERN_WARNING "ACPI: Wrong value from %s\n",
@@ -646,7 +656,9 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
646 *d_min_p = d_min; 656 *d_min_p = d_min;
647 return d_max; 657 return d_max;
648} 658}
659#endif /* CONFIG_PM_OPS */
649 660
661#ifdef CONFIG_PM_SLEEP
650/** 662/**
651 * acpi_pm_device_sleep_wake - enable or disable the system wake-up 663 * acpi_pm_device_sleep_wake - enable or disable the system wake-up
652 * capability of given device 664 * capability of given device
@@ -677,7 +689,7 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
677 689
678 return error; 690 return error;
679} 691}
680#endif 692#endif /* CONFIG_PM_SLEEP */
681 693
682static void acpi_power_off_prepare(void) 694static void acpi_power_off_prepare(void)
683{ 695{
@@ -702,7 +714,7 @@ static void acpi_power_off(void)
702 * paths through the BIOS, so disable _GTS and _BFS by default, 714 * paths through the BIOS, so disable _GTS and _BFS by default,
703 * but do speak up and offer the option to enable them. 715 * but do speak up and offer the option to enable them.
704 */ 716 */
705void __init acpi_gts_bfs_check(void) 717static void __init acpi_gts_bfs_check(void)
706{ 718{
707 acpi_handle dummy; 719 acpi_handle dummy;
708 720