diff options
Diffstat (limited to 'drivers/acpi/sleep.c')
| -rw-r--r-- | drivers/acpi/sleep.c | 163 |
1 files changed, 158 insertions, 5 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 3bde594a9979..e2e992599e68 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -450,6 +450,126 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 450 | }, | 450 | }, |
| 451 | }, | 451 | }, |
| 452 | { | 452 | { |
| 453 | .callback = init_set_sci_en_on_resume, | ||
| 454 | .ident = "Lenovo ThinkPad T410", | ||
| 455 | .matches = { | ||
| 456 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 457 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), | ||
| 458 | }, | ||
| 459 | }, | ||
| 460 | { | ||
| 461 | .callback = init_set_sci_en_on_resume, | ||
| 462 | .ident = "Lenovo ThinkPad T510", | ||
| 463 | .matches = { | ||
| 464 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 465 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), | ||
| 466 | }, | ||
| 467 | }, | ||
| 468 | { | ||
| 469 | .callback = init_set_sci_en_on_resume, | ||
| 470 | .ident = "Lenovo ThinkPad W510", | ||
| 471 | .matches = { | ||
| 472 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 473 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), | ||
| 474 | }, | ||
| 475 | }, | ||
| 476 | { | ||
| 477 | .callback = init_set_sci_en_on_resume, | ||
| 478 | .ident = "Lenovo ThinkPad X201", | ||
| 479 | .matches = { | ||
| 480 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 481 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), | ||
| 482 | }, | ||
| 483 | }, | ||
| 484 | { | ||
| 485 | .callback = init_set_sci_en_on_resume, | ||
| 486 | .ident = "Lenovo ThinkPad X201", | ||
| 487 | .matches = { | ||
| 488 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 489 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), | ||
| 490 | }, | ||
| 491 | }, | ||
| 492 | { | ||
| 493 | .callback = init_set_sci_en_on_resume, | ||
| 494 | .ident = "Lenovo ThinkPad T410", | ||
| 495 | .matches = { | ||
| 496 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 497 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), | ||
| 498 | }, | ||
| 499 | }, | ||
| 500 | { | ||
| 501 | .callback = init_set_sci_en_on_resume, | ||
| 502 | .ident = "Lenovo ThinkPad T510", | ||
| 503 | .matches = { | ||
| 504 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 505 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), | ||
| 506 | }, | ||
| 507 | }, | ||
| 508 | { | ||
| 509 | .callback = init_set_sci_en_on_resume, | ||
| 510 | .ident = "Lenovo ThinkPad W510", | ||
| 511 | .matches = { | ||
| 512 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 513 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), | ||
| 514 | }, | ||
| 515 | }, | ||
| 516 | { | ||
| 517 | .callback = init_set_sci_en_on_resume, | ||
| 518 | .ident = "Lenovo ThinkPad X201", | ||
| 519 | .matches = { | ||
| 520 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 521 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), | ||
| 522 | }, | ||
| 523 | }, | ||
| 524 | { | ||
| 525 | .callback = init_set_sci_en_on_resume, | ||
| 526 | .ident = "Lenovo ThinkPad X201", | ||
| 527 | .matches = { | ||
| 528 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 529 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), | ||
| 530 | }, | ||
| 531 | }, | ||
| 532 | { | ||
| 533 | .callback = init_set_sci_en_on_resume, | ||
| 534 | .ident = "Lenovo ThinkPad T410", | ||
| 535 | .matches = { | ||
| 536 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 537 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), | ||
| 538 | }, | ||
| 539 | }, | ||
| 540 | { | ||
| 541 | .callback = init_set_sci_en_on_resume, | ||
| 542 | .ident = "Lenovo ThinkPad T510", | ||
| 543 | .matches = { | ||
| 544 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 545 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), | ||
| 546 | }, | ||
| 547 | }, | ||
| 548 | { | ||
| 549 | .callback = init_set_sci_en_on_resume, | ||
| 550 | .ident = "Lenovo ThinkPad W510", | ||
| 551 | .matches = { | ||
| 552 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 553 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), | ||
| 554 | }, | ||
| 555 | }, | ||
| 556 | { | ||
| 557 | .callback = init_set_sci_en_on_resume, | ||
| 558 | .ident = "Lenovo ThinkPad X201", | ||
| 559 | .matches = { | ||
| 560 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 561 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), | ||
| 562 | }, | ||
| 563 | }, | ||
| 564 | { | ||
| 565 | .callback = init_set_sci_en_on_resume, | ||
| 566 | .ident = "Lenovo ThinkPad X201", | ||
| 567 | .matches = { | ||
| 568 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 569 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"), | ||
| 570 | }, | ||
| 571 | }, | ||
| 572 | { | ||
| 453 | .callback = init_old_suspend_ordering, | 573 | .callback = init_old_suspend_ordering, |
| 454 | .ident = "Panasonic CF51-2L", | 574 | .ident = "Panasonic CF51-2L", |
| 455 | .matches = { | 575 | .matches = { |
| @@ -458,6 +578,30 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 458 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), | 578 | DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), |
| 459 | }, | 579 | }, |
| 460 | }, | 580 | }, |
| 581 | { | ||
| 582 | .callback = init_set_sci_en_on_resume, | ||
| 583 | .ident = "Dell Studio 1558", | ||
| 584 | .matches = { | ||
| 585 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 586 | DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"), | ||
| 587 | }, | ||
| 588 | }, | ||
| 589 | { | ||
| 590 | .callback = init_set_sci_en_on_resume, | ||
| 591 | .ident = "Dell Studio 1557", | ||
| 592 | .matches = { | ||
| 593 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 594 | DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"), | ||
| 595 | }, | ||
| 596 | }, | ||
| 597 | { | ||
| 598 | .callback = init_set_sci_en_on_resume, | ||
| 599 | .ident = "Dell Studio 1555", | ||
| 600 | .matches = { | ||
| 601 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 602 | DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"), | ||
| 603 | }, | ||
| 604 | }, | ||
| 461 | {}, | 605 | {}, |
| 462 | }; | 606 | }; |
| 463 | #endif /* CONFIG_SUSPEND */ | 607 | #endif /* CONFIG_SUSPEND */ |
| @@ -552,8 +696,17 @@ static void acpi_hibernation_leave(void) | |||
| 552 | hibernate_nvs_restore(); | 696 | hibernate_nvs_restore(); |
| 553 | } | 697 | } |
| 554 | 698 | ||
| 555 | static void acpi_pm_enable_gpes(void) | 699 | static int acpi_pm_pre_restore(void) |
| 700 | { | ||
| 701 | acpi_disable_all_gpes(); | ||
| 702 | acpi_os_wait_events_complete(NULL); | ||
| 703 | acpi_ec_suspend_transactions(); | ||
| 704 | return 0; | ||
| 705 | } | ||
| 706 | |||
| 707 | static void acpi_pm_restore_cleanup(void) | ||
| 556 | { | 708 | { |
| 709 | acpi_ec_resume_transactions(); | ||
| 557 | acpi_enable_all_runtime_gpes(); | 710 | acpi_enable_all_runtime_gpes(); |
| 558 | } | 711 | } |
| 559 | 712 | ||
| @@ -565,8 +718,8 @@ static struct platform_hibernation_ops acpi_hibernation_ops = { | |||
| 565 | .prepare = acpi_pm_prepare, | 718 | .prepare = acpi_pm_prepare, |
| 566 | .enter = acpi_hibernation_enter, | 719 | .enter = acpi_hibernation_enter, |
| 567 | .leave = acpi_hibernation_leave, | 720 | .leave = acpi_hibernation_leave, |
| 568 | .pre_restore = acpi_pm_disable_gpes, | 721 | .pre_restore = acpi_pm_pre_restore, |
| 569 | .restore_cleanup = acpi_pm_enable_gpes, | 722 | .restore_cleanup = acpi_pm_restore_cleanup, |
| 570 | }; | 723 | }; |
| 571 | 724 | ||
| 572 | /** | 725 | /** |
| @@ -618,8 +771,8 @@ static struct platform_hibernation_ops acpi_hibernation_ops_old = { | |||
| 618 | .prepare = acpi_pm_disable_gpes, | 771 | .prepare = acpi_pm_disable_gpes, |
| 619 | .enter = acpi_hibernation_enter, | 772 | .enter = acpi_hibernation_enter, |
| 620 | .leave = acpi_hibernation_leave, | 773 | .leave = acpi_hibernation_leave, |
| 621 | .pre_restore = acpi_pm_disable_gpes, | 774 | .pre_restore = acpi_pm_pre_restore, |
| 622 | .restore_cleanup = acpi_pm_enable_gpes, | 775 | .restore_cleanup = acpi_pm_restore_cleanup, |
| 623 | .recover = acpi_pm_finish, | 776 | .recover = acpi_pm_finish, |
| 624 | }; | 777 | }; |
| 625 | #endif /* CONFIG_HIBERNATION */ | 778 | #endif /* CONFIG_HIBERNATION */ |
