diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 464ee6ea8c61..6d85289f1c12 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -691,6 +691,9 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
691 | acpi_status status = 0; | 691 | acpi_status status = 0; |
692 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 692 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
693 | union acpi_object *package = NULL; | 693 | union acpi_object *package = NULL; |
694 | union acpi_object in_arg[3]; | ||
695 | struct acpi_object_list arg_list = { 3, in_arg }; | ||
696 | acpi_status psw_status = AE_OK; | ||
694 | 697 | ||
695 | struct acpi_device_id button_device_ids[] = { | 698 | struct acpi_device_id button_device_ids[] = { |
696 | {"PNP0C0D", 0}, | 699 | {"PNP0C0D", 0}, |
@@ -699,7 +702,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
699 | {"", 0}, | 702 | {"", 0}, |
700 | }; | 703 | }; |
701 | 704 | ||
702 | |||
703 | /* _PRW */ | 705 | /* _PRW */ |
704 | status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); | 706 | status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer); |
705 | if (ACPI_FAILURE(status)) { | 707 | if (ACPI_FAILURE(status)) { |
@@ -717,6 +719,45 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device) | |||
717 | kfree(buffer.pointer); | 719 | kfree(buffer.pointer); |
718 | 720 | ||
719 | device->wakeup.flags.valid = 1; | 721 | device->wakeup.flags.valid = 1; |
722 | /* Call _PSW/_DSW object to disable its ability to wake the sleeping | ||
723 | * system for the ACPI device with the _PRW object. | ||
724 | * The _PSW object is depreciated in ACPI 3.0 and is replaced by _DSW. | ||
725 | * So it is necessary to call _DSW object first. Only when it is not | ||
726 | * present will the _PSW object used. | ||
727 | */ | ||
728 | /* | ||
729 | * Three agruments are needed for the _DSW object. | ||
730 | * Argument 0: enable/disable the wake capabilities | ||
731 | * When _DSW object is called to disable the wake capabilities, maybe | ||
732 | * the first argument is filled. The value of the other two agruments | ||
733 | * is meaningless. | ||
734 | */ | ||
735 | in_arg[0].type = ACPI_TYPE_INTEGER; | ||
736 | in_arg[0].integer.value = 0; | ||
737 | in_arg[1].type = ACPI_TYPE_INTEGER; | ||
738 | in_arg[1].integer.value = 0; | ||
739 | in_arg[2].type = ACPI_TYPE_INTEGER; | ||
740 | in_arg[2].integer.value = 0; | ||
741 | psw_status = acpi_evaluate_object(device->handle, "_DSW", | ||
742 | &arg_list, NULL); | ||
743 | if (ACPI_FAILURE(psw_status) && (psw_status != AE_NOT_FOUND)) | ||
744 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "error in evaluate _DSW\n")); | ||
745 | /* | ||
746 | * When the _DSW object is not present, OSPM will call _PSW object. | ||
747 | */ | ||
748 | if (psw_status == AE_NOT_FOUND) { | ||
749 | /* | ||
750 | * Only one agruments is required for the _PSW object. | ||
751 | * agrument 0: enable/disable the wake capabilities | ||
752 | */ | ||
753 | arg_list.count = 1; | ||
754 | in_arg[0].integer.value = 0; | ||
755 | psw_status = acpi_evaluate_object(device->handle, "_PSW", | ||
756 | &arg_list, NULL); | ||
757 | if (ACPI_FAILURE(psw_status) && (psw_status != AE_NOT_FOUND)) | ||
758 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "error in " | ||
759 | "evaluate _PSW\n")); | ||
760 | } | ||
720 | /* Power button, Lid switch always enable wakeup */ | 761 | /* Power button, Lid switch always enable wakeup */ |
721 | if (!acpi_match_device_ids(device, button_device_ids)) | 762 | if (!acpi_match_device_ids(device, button_device_ids)) |
722 | device->wakeup.flags.run_wake = 1; | 763 | device->wakeup.flags.run_wake = 1; |
@@ -881,10 +922,7 @@ static void acpi_device_get_busid(struct acpi_device *device, | |||
881 | static int | 922 | static int |
882 | acpi_video_bus_match(struct acpi_device *device) | 923 | acpi_video_bus_match(struct acpi_device *device) |
883 | { | 924 | { |
884 | acpi_handle h_dummy1; | 925 | acpi_handle h_dummy; |
885 | acpi_handle h_dummy2; | ||
886 | acpi_handle h_dummy3; | ||
887 | |||
888 | 926 | ||
889 | if (!device) | 927 | if (!device) |
890 | return -EINVAL; | 928 | return -EINVAL; |
@@ -894,18 +932,18 @@ acpi_video_bus_match(struct acpi_device *device) | |||
894 | */ | 932 | */ |
895 | 933 | ||
896 | /* Does this device able to support video switching ? */ | 934 | /* Does this device able to support video switching ? */ |
897 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) && | 935 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) && |
898 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) | 936 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy))) |
899 | return 0; | 937 | return 0; |
900 | 938 | ||
901 | /* Does this device able to retrieve a video ROM ? */ | 939 | /* Does this device able to retrieve a video ROM ? */ |
902 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) | 940 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy))) |
903 | return 0; | 941 | return 0; |
904 | 942 | ||
905 | /* Does this device able to configure which video head to be POSTed ? */ | 943 | /* Does this device able to configure which video head to be POSTed ? */ |
906 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) && | 944 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) && |
907 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) && | 945 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) && |
908 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) | 946 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy))) |
909 | return 0; | 947 | return 0; |
910 | 948 | ||
911 | return -ENODEV; | 949 | return -ENODEV; |