sleep.c (ef25ba0476015908ef5960f9faac149ddf34ede0) sleep.c (8c01275e0cdf1959aa25c322fd5870c097733195)
1/*
2 * sleep.c - ACPI sleep support.
3 *
4 * Copyright (c) 2005 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
5 * Copyright (c) 2004 David Shaohua Li <shaohua.li@intel.com>
6 * Copyright (c) 2000-2003 Patrick Mochel
7 * Copyright (c) 2003 Open Source Development Lab
8 *

--- 473 unchanged lines hidden (view full) ---

482 error = (nvs_nosave || nvs_nosave_s3) ? 0 : suspend_nvs_alloc();
483 if (error)
484 return error;
485
486 if (!sleep_states[acpi_state]) {
487 pr_err("ACPI does not support sleep state S%u\n", acpi_state);
488 return -ENOSYS;
489 }
1/*
2 * sleep.c - ACPI sleep support.
3 *
4 * Copyright (c) 2005 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
5 * Copyright (c) 2004 David Shaohua Li <shaohua.li@intel.com>
6 * Copyright (c) 2000-2003 Patrick Mochel
7 * Copyright (c) 2003 Open Source Development Lab
8 *

--- 473 unchanged lines hidden (view full) ---

482 error = (nvs_nosave || nvs_nosave_s3) ? 0 : suspend_nvs_alloc();
483 if (error)
484 return error;
485
486 if (!sleep_states[acpi_state]) {
487 pr_err("ACPI does not support sleep state S%u\n", acpi_state);
488 return -ENOSYS;
489 }
490 if (acpi_state > ACPI_STATE_S1)
491 pm_set_suspend_via_firmware();
492
493 acpi_pm_start(acpi_state);
494 return 0;
495}
496
497/**
498 * acpi_suspend_enter - Actually enter a sleep state.
499 * @pm_state: ignored

--- 19 unchanged lines hidden (view full) ---

519
520 case ACPI_STATE_S3:
521 if (!acpi_suspend_lowlevel)
522 return -ENOSYS;
523 error = acpi_suspend_lowlevel();
524 if (error)
525 return error;
526 pr_info(PREFIX "Low-level resume complete\n");
490
491 acpi_pm_start(acpi_state);
492 return 0;
493}
494
495/**
496 * acpi_suspend_enter - Actually enter a sleep state.
497 * @pm_state: ignored

--- 19 unchanged lines hidden (view full) ---

517
518 case ACPI_STATE_S3:
519 if (!acpi_suspend_lowlevel)
520 return -ENOSYS;
521 error = acpi_suspend_lowlevel();
522 if (error)
523 return error;
524 pr_info(PREFIX "Low-level resume complete\n");
527 pm_set_resume_via_firmware();
528 break;
529 }
530 trace_suspend_resume(TPS("acpi_suspend"), acpi_state, false);
531
532 /* This violates the spec but is required for bug compatibility. */
533 acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
534
535 /* Reprogram control registers */

--- 94 unchanged lines hidden (view full) ---

630 return 0;
631}
632
633static int acpi_freeze_prepare(void)
634{
635 acpi_enable_wakeup_devices(ACPI_STATE_S0);
636 acpi_enable_all_wakeup_gpes();
637 acpi_os_wait_events_complete();
525 break;
526 }
527 trace_suspend_resume(TPS("acpi_suspend"), acpi_state, false);
528
529 /* This violates the spec but is required for bug compatibility. */
530 acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
531
532 /* Reprogram control registers */

--- 94 unchanged lines hidden (view full) ---

627 return 0;
628}
629
630static int acpi_freeze_prepare(void)
631{
632 acpi_enable_wakeup_devices(ACPI_STATE_S0);
633 acpi_enable_all_wakeup_gpes();
634 acpi_os_wait_events_complete();
638 enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
635 if (acpi_sci_irq_valid())
636 enable_irq_wake(acpi_sci_irq);
639 return 0;
640}
641
642static void acpi_freeze_restore(void)
643{
644 acpi_disable_wakeup_devices(ACPI_STATE_S0);
637 return 0;
638}
639
640static void acpi_freeze_restore(void)
641{
642 acpi_disable_wakeup_devices(ACPI_STATE_S0);
645 disable_irq_wake(acpi_gbl_FADT.sci_interrupt);
643 if (acpi_sci_irq_valid())
644 disable_irq_wake(acpi_sci_irq);
646 acpi_enable_all_runtime_gpes();
647}
648
649static void acpi_freeze_end(void)
650{
651 acpi_scan_lock_release();
652}
653

--- 209 unchanged lines hidden ---
645 acpi_enable_all_runtime_gpes();
646}
647
648static void acpi_freeze_end(void)
649{
650 acpi_scan_lock_release();
651}
652

--- 209 unchanged lines hidden ---