diff options
Diffstat (limited to 'drivers/platform/x86/toshiba_acpi.c')
-rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index eb3467ea6d86..0cfadb65f7c6 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -191,16 +191,9 @@ static __inline__ void _set_bit(u32 * word, u32 mask, int value) | |||
191 | 191 | ||
192 | static int write_acpi_int(const char *methodName, int val) | 192 | static int write_acpi_int(const char *methodName, int val) |
193 | { | 193 | { |
194 | struct acpi_object_list params; | ||
195 | union acpi_object in_objs[1]; | ||
196 | acpi_status status; | 194 | acpi_status status; |
197 | 195 | ||
198 | params.count = ARRAY_SIZE(in_objs); | 196 | status = acpi_execute_simple_method(NULL, (char *)methodName, val); |
199 | params.pointer = in_objs; | ||
200 | in_objs[0].type = ACPI_TYPE_INTEGER; | ||
201 | in_objs[0].integer.value = val; | ||
202 | |||
203 | status = acpi_evaluate_object(NULL, (char *)methodName, ¶ms, NULL); | ||
204 | return (status == AE_OK) ? 0 : -EIO; | 197 | return (status == AE_OK) ? 0 : -EIO; |
205 | } | 198 | } |
206 | 199 | ||
@@ -947,21 +940,17 @@ static void toshiba_acpi_hotkey_work(struct work_struct *work) | |||
947 | */ | 940 | */ |
948 | static int toshiba_acpi_query_hotkey(struct toshiba_acpi_dev *dev) | 941 | static int toshiba_acpi_query_hotkey(struct toshiba_acpi_dev *dev) |
949 | { | 942 | { |
950 | struct acpi_buffer buf; | 943 | unsigned long long value; |
951 | union acpi_object out_obj; | ||
952 | acpi_status status; | 944 | acpi_status status; |
953 | 945 | ||
954 | buf.pointer = &out_obj; | 946 | status = acpi_evaluate_integer(dev->acpi_dev->handle, "INFO", |
955 | buf.length = sizeof(out_obj); | 947 | NULL, &value); |
956 | 948 | if (ACPI_FAILURE(status)) { | |
957 | status = acpi_evaluate_object(dev->acpi_dev->handle, "INFO", | ||
958 | NULL, &buf); | ||
959 | if (ACPI_FAILURE(status) || out_obj.type != ACPI_TYPE_INTEGER) { | ||
960 | pr_err("ACPI INFO method execution failed\n"); | 949 | pr_err("ACPI INFO method execution failed\n"); |
961 | return -EIO; | 950 | return -EIO; |
962 | } | 951 | } |
963 | 952 | ||
964 | return out_obj.integer.value; | 953 | return value; |
965 | } | 954 | } |
966 | 955 | ||
967 | static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev, | 956 | static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev, |
@@ -981,7 +970,7 @@ static void toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev, | |||
981 | static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | 970 | static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) |
982 | { | 971 | { |
983 | acpi_status status; | 972 | acpi_status status; |
984 | acpi_handle ec_handle, handle; | 973 | acpi_handle ec_handle; |
985 | int error; | 974 | int error; |
986 | u32 hci_result; | 975 | u32 hci_result; |
987 | 976 | ||
@@ -1008,10 +997,7 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
1008 | */ | 997 | */ |
1009 | status = AE_ERROR; | 998 | status = AE_ERROR; |
1010 | ec_handle = ec_get_handle(); | 999 | ec_handle = ec_get_handle(); |
1011 | if (ec_handle) | 1000 | if (ec_handle && acpi_has_method(ec_handle, "NTFY")) { |
1012 | status = acpi_get_handle(ec_handle, "NTFY", &handle); | ||
1013 | |||
1014 | if (ACPI_SUCCESS(status)) { | ||
1015 | INIT_WORK(&dev->hotkey_work, toshiba_acpi_hotkey_work); | 1001 | INIT_WORK(&dev->hotkey_work, toshiba_acpi_hotkey_work); |
1016 | 1002 | ||
1017 | error = i8042_install_filter(toshiba_acpi_i8042_filter); | 1003 | error = i8042_install_filter(toshiba_acpi_i8042_filter); |
@@ -1027,10 +1013,9 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
1027 | * Determine hotkey query interface. Prefer using the INFO | 1013 | * Determine hotkey query interface. Prefer using the INFO |
1028 | * method when it is available. | 1014 | * method when it is available. |
1029 | */ | 1015 | */ |
1030 | status = acpi_get_handle(dev->acpi_dev->handle, "INFO", &handle); | 1016 | if (acpi_has_method(dev->acpi_dev->handle, "INFO")) |
1031 | if (ACPI_SUCCESS(status)) { | ||
1032 | dev->info_supported = 1; | 1017 | dev->info_supported = 1; |
1033 | } else { | 1018 | else { |
1034 | hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result); | 1019 | hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result); |
1035 | if (hci_result == HCI_SUCCESS) | 1020 | if (hci_result == HCI_SUCCESS) |
1036 | dev->system_event_supported = 1; | 1021 | dev->system_event_supported = 1; |
@@ -1155,15 +1140,10 @@ static int toshiba_acpi_remove(struct acpi_device *acpi_dev) | |||
1155 | 1140 | ||
1156 | static const char *find_hci_method(acpi_handle handle) | 1141 | static const char *find_hci_method(acpi_handle handle) |
1157 | { | 1142 | { |
1158 | acpi_status status; | 1143 | if (acpi_has_method(handle, "GHCI")) |
1159 | acpi_handle hci_handle; | ||
1160 | |||
1161 | status = acpi_get_handle(handle, "GHCI", &hci_handle); | ||
1162 | if (ACPI_SUCCESS(status)) | ||
1163 | return "GHCI"; | 1144 | return "GHCI"; |
1164 | 1145 | ||
1165 | status = acpi_get_handle(handle, "SPFC", &hci_handle); | 1146 | if (acpi_has_method(handle, "SPFC")) |
1166 | if (ACPI_SUCCESS(status)) | ||
1167 | return "SPFC"; | 1147 | return "SPFC"; |
1168 | 1148 | ||
1169 | return NULL; | 1149 | return NULL; |