aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/toshiba_acpi.c129
1 files changed, 62 insertions, 67 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 589a85836c1a..5d509eac8ce6 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -317,47 +317,49 @@ static acpi_status tci_raw(struct toshiba_acpi_dev *dev,
317 * may be useful (such as "not supported"). 317 * may be useful (such as "not supported").
318 */ 318 */
319 319
320static acpi_status hci_write1(struct toshiba_acpi_dev *dev, u32 reg, 320static u32 hci_write1(struct toshiba_acpi_dev *dev, u32 reg, u32 in1)
321 u32 in1, u32 *result)
322{ 321{
323 u32 in[TCI_WORDS] = { HCI_SET, reg, in1, 0, 0, 0 }; 322 u32 in[TCI_WORDS] = { HCI_SET, reg, in1, 0, 0, 0 };
324 u32 out[TCI_WORDS]; 323 u32 out[TCI_WORDS];
325 acpi_status status = tci_raw(dev, in, out); 324 acpi_status status = tci_raw(dev, in, out);
326 *result = (status == AE_OK) ? out[0] : TOS_FAILURE; 325
327 return status; 326 return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE;
328} 327}
329 328
330static acpi_status hci_read1(struct toshiba_acpi_dev *dev, u32 reg, 329static u32 hci_read1(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1)
331 u32 *out1, u32 *result)
332{ 330{
333 u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 }; 331 u32 in[TCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 };
334 u32 out[TCI_WORDS]; 332 u32 out[TCI_WORDS];
335 acpi_status status = tci_raw(dev, in, out); 333 acpi_status status = tci_raw(dev, in, out);
334 if (ACPI_FAILURE(status))
335 return TOS_FAILURE;
336
336 *out1 = out[2]; 337 *out1 = out[2];
337 *result = (status == AE_OK) ? out[0] : TOS_FAILURE; 338
338 return status; 339 return out[0];
339} 340}
340 341
341static acpi_status hci_write2(struct toshiba_acpi_dev *dev, u32 reg, 342static u32 hci_write2(struct toshiba_acpi_dev *dev, u32 reg, u32 in1, u32 in2)
342 u32 in1, u32 in2, u32 *result)
343{ 343{
344 u32 in[TCI_WORDS] = { HCI_SET, reg, in1, in2, 0, 0 }; 344 u32 in[TCI_WORDS] = { HCI_SET, reg, in1, in2, 0, 0 };
345 u32 out[TCI_WORDS]; 345 u32 out[TCI_WORDS];
346 acpi_status status = tci_raw(dev, in, out); 346 acpi_status status = tci_raw(dev, in, out);
347 *result = (status == AE_OK) ? out[0] : TOS_FAILURE; 347
348 return status; 348 return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE;
349} 349}
350 350
351static acpi_status hci_read2(struct toshiba_acpi_dev *dev, u32 reg, 351static u32 hci_read2(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1, u32 *out2)
352 u32 *out1, u32 *out2, u32 *result)
353{ 352{
354 u32 in[TCI_WORDS] = { HCI_GET, reg, *out1, *out2, 0, 0 }; 353 u32 in[TCI_WORDS] = { HCI_GET, reg, *out1, *out2, 0, 0 };
355 u32 out[TCI_WORDS]; 354 u32 out[TCI_WORDS];
356 acpi_status status = tci_raw(dev, in, out); 355 acpi_status status = tci_raw(dev, in, out);
356 if (ACPI_FAILURE(status))
357 return TOS_FAILURE;
358
357 *out1 = out[2]; 359 *out1 = out[2];
358 *out2 = out[3]; 360 *out2 = out[3];
359 *result = (status == AE_OK) ? out[0] : TOS_FAILURE; 361
360 return status; 362 return out[0];
361} 363}
362 364
363/* common sci tasks 365/* common sci tasks
@@ -407,25 +409,26 @@ static void sci_close(struct toshiba_acpi_dev *dev)
407 pr_info("Toshiba SCI is not present\n"); 409 pr_info("Toshiba SCI is not present\n");
408} 410}
409 411
410static acpi_status sci_read(struct toshiba_acpi_dev *dev, u32 reg, 412static u32 sci_read(struct toshiba_acpi_dev *dev, u32 reg, u32 *out1)
411 u32 *out1, u32 *result)
412{ 413{
413 u32 in[TCI_WORDS] = { SCI_GET, reg, 0, 0, 0, 0 }; 414 u32 in[TCI_WORDS] = { SCI_GET, reg, 0, 0, 0, 0 };
414 u32 out[TCI_WORDS]; 415 u32 out[TCI_WORDS];
415 acpi_status status = tci_raw(dev, in, out); 416 acpi_status status = tci_raw(dev, in, out);
417 if (ACPI_FAILURE(status))
418 return TOS_FAILURE;
419
416 *out1 = out[2]; 420 *out1 = out[2];
417 *result = (ACPI_SUCCESS(status)) ? out[0] : TOS_FAILURE; 421
418 return status; 422 return out[0];
419} 423}
420 424
421static acpi_status sci_write(struct toshiba_acpi_dev *dev, u32 reg, 425static u32 sci_write(struct toshiba_acpi_dev *dev, u32 reg, u32 in1)
422 u32 in1, u32 *result)
423{ 426{
424 u32 in[TCI_WORDS] = { SCI_SET, reg, in1, 0, 0, 0 }; 427 u32 in[TCI_WORDS] = { SCI_SET, reg, in1, 0, 0, 0 };
425 u32 out[TCI_WORDS]; 428 u32 out[TCI_WORDS];
426 acpi_status status = tci_raw(dev, in, out); 429 acpi_status status = tci_raw(dev, in, out);
427 *result = (ACPI_SUCCESS(status)) ? out[0] : TOS_FAILURE; 430
428 return status; 431 return ACPI_SUCCESS(status) ? out[0] : TOS_FAILURE;
429} 432}
430 433
431/* Illumination support */ 434/* Illumination support */
@@ -457,7 +460,6 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
457 struct toshiba_acpi_dev *dev = container_of(cdev, 460 struct toshiba_acpi_dev *dev = container_of(cdev,
458 struct toshiba_acpi_dev, led_dev); 461 struct toshiba_acpi_dev, led_dev);
459 u32 state, result; 462 u32 state, result;
460 acpi_status status;
461 463
462 /* First request : initialize communication. */ 464 /* First request : initialize communication. */
463 if (!sci_open(dev)) 465 if (!sci_open(dev))
@@ -465,9 +467,9 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
465 467
466 /* Switch the illumination on/off */ 468 /* Switch the illumination on/off */
467 state = brightness ? 1 : 0; 469 state = brightness ? 1 : 0;
468 status = sci_write(dev, SCI_ILLUMINATION, state, &result); 470 result = sci_write(dev, SCI_ILLUMINATION, state);
469 sci_close(dev); 471 sci_close(dev);
470 if (ACPI_FAILURE(status)) { 472 if (result == TOS_FAILURE) {
471 pr_err("ACPI call for illumination failed\n"); 473 pr_err("ACPI call for illumination failed\n");
472 return; 474 return;
473 } else if (result == TOS_NOT_SUPPORTED) { 475 } else if (result == TOS_NOT_SUPPORTED) {
@@ -481,16 +483,15 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
481 struct toshiba_acpi_dev *dev = container_of(cdev, 483 struct toshiba_acpi_dev *dev = container_of(cdev,
482 struct toshiba_acpi_dev, led_dev); 484 struct toshiba_acpi_dev, led_dev);
483 u32 state, result; 485 u32 state, result;
484 acpi_status status;
485 486
486 /* First request : initialize communication. */ 487 /* First request : initialize communication. */
487 if (!sci_open(dev)) 488 if (!sci_open(dev))
488 return LED_OFF; 489 return LED_OFF;
489 490
490 /* Check the illumination */ 491 /* Check the illumination */
491 status = sci_read(dev, SCI_ILLUMINATION, &state, &result); 492 result = sci_read(dev, SCI_ILLUMINATION, &state);
492 sci_close(dev); 493 sci_close(dev);
493 if (ACPI_FAILURE(status) || result == TOS_INPUT_DATA_ERROR) { 494 if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) {
494 pr_err("ACPI call for illumination failed\n"); 495 pr_err("ACPI call for illumination failed\n");
495 return LED_OFF; 496 return LED_OFF;
496 } else if (result == TOS_NOT_SUPPORTED) { 497 } else if (result == TOS_NOT_SUPPORTED) {
@@ -541,14 +542,13 @@ static int toshiba_kbd_illum_available(struct toshiba_acpi_dev *dev)
541static int toshiba_kbd_illum_status_set(struct toshiba_acpi_dev *dev, u32 time) 542static int toshiba_kbd_illum_status_set(struct toshiba_acpi_dev *dev, u32 time)
542{ 543{
543 u32 result; 544 u32 result;
544 acpi_status status;
545 545
546 if (!sci_open(dev)) 546 if (!sci_open(dev))
547 return -EIO; 547 return -EIO;
548 548
549 status = sci_write(dev, SCI_KBD_ILLUM_STATUS, time, &result); 549 result = sci_write(dev, SCI_KBD_ILLUM_STATUS, time);
550 sci_close(dev); 550 sci_close(dev);
551 if (ACPI_FAILURE(status) || result == TOS_INPUT_DATA_ERROR) { 551 if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) {
552 pr_err("ACPI call to set KBD backlight status failed\n"); 552 pr_err("ACPI call to set KBD backlight status failed\n");
553 return -EIO; 553 return -EIO;
554 } else if (result == TOS_NOT_SUPPORTED) { 554 } else if (result == TOS_NOT_SUPPORTED) {
@@ -562,14 +562,13 @@ static int toshiba_kbd_illum_status_set(struct toshiba_acpi_dev *dev, u32 time)
562static int toshiba_kbd_illum_status_get(struct toshiba_acpi_dev *dev, u32 *time) 562static int toshiba_kbd_illum_status_get(struct toshiba_acpi_dev *dev, u32 *time)
563{ 563{
564 u32 result; 564 u32 result;
565 acpi_status status;
566 565
567 if (!sci_open(dev)) 566 if (!sci_open(dev))
568 return -EIO; 567 return -EIO;
569 568
570 status = sci_read(dev, SCI_KBD_ILLUM_STATUS, time, &result); 569 result = sci_read(dev, SCI_KBD_ILLUM_STATUS, time);
571 sci_close(dev); 570 sci_close(dev);
572 if (ACPI_FAILURE(status) || result == TOS_INPUT_DATA_ERROR) { 571 if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) {
573 pr_err("ACPI call to get KBD backlight status failed\n"); 572 pr_err("ACPI call to get KBD backlight status failed\n");
574 return -EIO; 573 return -EIO;
575 } else if (result == TOS_NOT_SUPPORTED) { 574 } else if (result == TOS_NOT_SUPPORTED) {
@@ -585,11 +584,10 @@ static enum led_brightness toshiba_kbd_backlight_get(struct led_classdev *cdev)
585 struct toshiba_acpi_dev *dev = container_of(cdev, 584 struct toshiba_acpi_dev *dev = container_of(cdev,
586 struct toshiba_acpi_dev, kbd_led); 585 struct toshiba_acpi_dev, kbd_led);
587 u32 state, result; 586 u32 state, result;
588 acpi_status status;
589 587
590 /* Check the keyboard backlight state */ 588 /* Check the keyboard backlight state */
591 status = hci_read1(dev, HCI_KBD_ILLUMINATION, &state, &result); 589 result = hci_read1(dev, HCI_KBD_ILLUMINATION, &state);
592 if (ACPI_FAILURE(status) || result == TOS_INPUT_DATA_ERROR) { 590 if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) {
593 pr_err("ACPI call to get the keyboard backlight failed\n"); 591 pr_err("ACPI call to get the keyboard backlight failed\n");
594 return LED_OFF; 592 return LED_OFF;
595 } else if (result == TOS_NOT_SUPPORTED) { 593 } else if (result == TOS_NOT_SUPPORTED) {
@@ -606,12 +604,11 @@ static void toshiba_kbd_backlight_set(struct led_classdev *cdev,
606 struct toshiba_acpi_dev *dev = container_of(cdev, 604 struct toshiba_acpi_dev *dev = container_of(cdev,
607 struct toshiba_acpi_dev, kbd_led); 605 struct toshiba_acpi_dev, kbd_led);
608 u32 state, result; 606 u32 state, result;
609 acpi_status status;
610 607
611 /* Set the keyboard backlight state */ 608 /* Set the keyboard backlight state */
612 state = brightness ? 1 : 0; 609 state = brightness ? 1 : 0;
613 status = hci_write1(dev, HCI_KBD_ILLUMINATION, state, &result); 610 result = hci_write1(dev, HCI_KBD_ILLUMINATION, state);
614 if (ACPI_FAILURE(status) || result == TOS_INPUT_DATA_ERROR) { 611 if (result == TOS_FAILURE || result == TOS_INPUT_DATA_ERROR) {
615 pr_err("ACPI call to set KBD Illumination mode failed\n"); 612 pr_err("ACPI call to set KBD Illumination mode failed\n");
616 return; 613 return;
617 } else if (result == TOS_NOT_SUPPORTED) { 614 } else if (result == TOS_NOT_SUPPORTED) {
@@ -624,14 +621,13 @@ static void toshiba_kbd_backlight_set(struct led_classdev *cdev,
624static int toshiba_touchpad_set(struct toshiba_acpi_dev *dev, u32 state) 621static int toshiba_touchpad_set(struct toshiba_acpi_dev *dev, u32 state)
625{ 622{
626 u32 result; 623 u32 result;
627 acpi_status status;
628 624
629 if (!sci_open(dev)) 625 if (!sci_open(dev))
630 return -EIO; 626 return -EIO;
631 627
632 status = sci_write(dev, SCI_TOUCHPAD, state, &result); 628 result = sci_write(dev, SCI_TOUCHPAD, state);
633 sci_close(dev); 629 sci_close(dev);
634 if (ACPI_FAILURE(status)) { 630 if (result == TOS_FAILURE) {
635 pr_err("ACPI call to set the touchpad failed\n"); 631 pr_err("ACPI call to set the touchpad failed\n");
636 return -EIO; 632 return -EIO;
637 } else if (result == TOS_NOT_SUPPORTED) { 633 } else if (result == TOS_NOT_SUPPORTED) {
@@ -644,14 +640,13 @@ static int toshiba_touchpad_set(struct toshiba_acpi_dev *dev, u32 state)
644static int toshiba_touchpad_get(struct toshiba_acpi_dev *dev, u32 *state) 640static int toshiba_touchpad_get(struct toshiba_acpi_dev *dev, u32 *state)
645{ 641{
646 u32 result; 642 u32 result;
647 acpi_status status;
648 643
649 if (!sci_open(dev)) 644 if (!sci_open(dev))
650 return -EIO; 645 return -EIO;
651 646
652 status = sci_read(dev, SCI_TOUCHPAD, state, &result); 647 result = sci_read(dev, SCI_TOUCHPAD, state);
653 sci_close(dev); 648 sci_close(dev);
654 if (ACPI_FAILURE(status)) { 649 if (result == TOS_FAILURE) {
655 pr_err("ACPI call to query the touchpad failed\n"); 650 pr_err("ACPI call to query the touchpad failed\n");
656 return -EIO; 651 return -EIO;
657 } else if (result == TOS_NOT_SUPPORTED) { 652 } else if (result == TOS_NOT_SUPPORTED) {
@@ -767,7 +762,7 @@ static u32 hci_get_bt_present(struct toshiba_acpi_dev *dev, bool *present)
767 762
768 value = 0; 763 value = 0;
769 value2 = 0; 764 value2 = 0;
770 hci_read2(dev, HCI_WIRELESS, &value, &value2, &hci_result); 765 hci_result = hci_read2(dev, HCI_WIRELESS, &value, &value2);
771 if (hci_result == TOS_SUCCESS) 766 if (hci_result == TOS_SUCCESS)
772 *present = (value & HCI_WIRELESS_BT_PRESENT) ? true : false; 767 *present = (value & HCI_WIRELESS_BT_PRESENT) ? true : false;
773 768
@@ -781,7 +776,7 @@ static u32 hci_get_radio_state(struct toshiba_acpi_dev *dev, bool *radio_state)
781 776
782 value = 0; 777 value = 0;
783 value2 = 0x0001; 778 value2 = 0x0001;
784 hci_read2(dev, HCI_WIRELESS, &value, &value2, &hci_result); 779 hci_result = hci_read2(dev, HCI_WIRELESS, &value, &value2);
785 780
786 *radio_state = value & HCI_WIRELESS_KILL_SWITCH; 781 *radio_state = value & HCI_WIRELESS_KILL_SWITCH;
787 return hci_result; 782 return hci_result;
@@ -808,8 +803,8 @@ static int bt_rfkill_set_block(void *data, bool blocked)
808 goto out; 803 goto out;
809 } 804 }
810 805
811 hci_write2(dev, HCI_WIRELESS, value, HCI_WIRELESS_BT_POWER, &result1); 806 result1 = hci_write2(dev, HCI_WIRELESS, value, HCI_WIRELESS_BT_POWER);
812 hci_write2(dev, HCI_WIRELESS, value, HCI_WIRELESS_BT_ATTACH, &result2); 807 result2 = hci_write2(dev, HCI_WIRELESS, value, HCI_WIRELESS_BT_ATTACH);
813 808
814 if (result1 != TOS_SUCCESS || result2 != TOS_SUCCESS) 809 if (result1 != TOS_SUCCESS || result2 != TOS_SUCCESS)
815 err = -EIO; 810 err = -EIO;
@@ -854,7 +849,7 @@ static int get_tr_backlight_status(struct toshiba_acpi_dev *dev, bool *enabled)
854 u32 hci_result; 849 u32 hci_result;
855 u32 status; 850 u32 status;
856 851
857 hci_read1(dev, HCI_TR_BACKLIGHT, &status, &hci_result); 852 hci_result = hci_read1(dev, HCI_TR_BACKLIGHT, &status);
858 *enabled = !status; 853 *enabled = !status;
859 return hci_result == TOS_SUCCESS ? 0 : -EIO; 854 return hci_result == TOS_SUCCESS ? 0 : -EIO;
860} 855}
@@ -864,7 +859,7 @@ static int set_tr_backlight_status(struct toshiba_acpi_dev *dev, bool enable)
864 u32 hci_result; 859 u32 hci_result;
865 u32 value = !enable; 860 u32 value = !enable;
866 861
867 hci_write1(dev, HCI_TR_BACKLIGHT, value, &hci_result); 862 hci_result = hci_write1(dev, HCI_TR_BACKLIGHT, value);
868 return hci_result == TOS_SUCCESS ? 0 : -EIO; 863 return hci_result == TOS_SUCCESS ? 0 : -EIO;
869} 864}
870 865
@@ -886,7 +881,7 @@ static int __get_lcd_brightness(struct toshiba_acpi_dev *dev)
886 brightness++; 881 brightness++;
887 } 882 }
888 883
889 hci_read1(dev, HCI_LCD_BRIGHTNESS, &value, &hci_result); 884 hci_result = hci_read1(dev, HCI_LCD_BRIGHTNESS, &value);
890 if (hci_result == TOS_SUCCESS) 885 if (hci_result == TOS_SUCCESS)
891 return brightness + (value >> HCI_LCD_BRIGHTNESS_SHIFT); 886 return brightness + (value >> HCI_LCD_BRIGHTNESS_SHIFT);
892 887
@@ -1001,7 +996,7 @@ static int get_video_status(struct toshiba_acpi_dev *dev, u32 *status)
1001{ 996{
1002 u32 hci_result; 997 u32 hci_result;
1003 998
1004 hci_read1(dev, HCI_VIDEO_OUT, status, &hci_result); 999 hci_result = hci_read1(dev, HCI_VIDEO_OUT, status);
1005 return hci_result == TOS_SUCCESS ? 0 : -EIO; 1000 return hci_result == TOS_SUCCESS ? 0 : -EIO;
1006} 1001}
1007 1002
@@ -1105,7 +1100,7 @@ static int get_fan_status(struct toshiba_acpi_dev *dev, u32 *status)
1105{ 1100{
1106 u32 hci_result; 1101 u32 hci_result;
1107 1102
1108 hci_read1(dev, HCI_FAN, status, &hci_result); 1103 hci_result = hci_read1(dev, HCI_FAN, status);
1109 return hci_result == TOS_SUCCESS ? 0 : -EIO; 1104 return hci_result == TOS_SUCCESS ? 0 : -EIO;
1110} 1105}
1111 1106
@@ -1145,7 +1140,7 @@ static ssize_t fan_proc_write(struct file *file, const char __user *buf,
1145 1140
1146 if (sscanf(cmd, " force_on : %i", &value) == 1 && 1141 if (sscanf(cmd, " force_on : %i", &value) == 1 &&
1147 value >= 0 && value <= 1) { 1142 value >= 0 && value <= 1) {
1148 hci_write1(dev, HCI_FAN, value, &hci_result); 1143 hci_result = hci_write1(dev, HCI_FAN, value);
1149 if (hci_result != TOS_SUCCESS) 1144 if (hci_result != TOS_SUCCESS)
1150 return -EIO; 1145 return -EIO;
1151 else 1146 else
@@ -1173,7 +1168,7 @@ static int keys_proc_show(struct seq_file *m, void *v)
1173 u32 value; 1168 u32 value;
1174 1169
1175 if (!dev->key_event_valid && dev->system_event_supported) { 1170 if (!dev->key_event_valid && dev->system_event_supported) {
1176 hci_read1(dev, HCI_SYSTEM_EVENT, &value, &hci_result); 1171 hci_result = hci_read1(dev, HCI_SYSTEM_EVENT, &value);
1177 if (hci_result == TOS_SUCCESS) { 1172 if (hci_result == TOS_SUCCESS) {
1178 dev->key_event_valid = 1; 1173 dev->key_event_valid = 1;
1179 dev->last_key_event = value; 1174 dev->last_key_event = value;
@@ -1183,7 +1178,7 @@ static int keys_proc_show(struct seq_file *m, void *v)
1183 /* This is a workaround for an unresolved issue on 1178 /* This is a workaround for an unresolved issue on
1184 * some machines where system events sporadically 1179 * some machines where system events sporadically
1185 * become disabled. */ 1180 * become disabled. */
1186 hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result); 1181 hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1);
1187 pr_notice("Re-enabled hotkeys\n"); 1182 pr_notice("Re-enabled hotkeys\n");
1188 } else { 1183 } else {
1189 pr_err("Error reading hotkey status\n"); 1184 pr_err("Error reading hotkey status\n");
@@ -1677,7 +1672,7 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
1677 if (acpi_has_method(dev->acpi_dev->handle, "INFO")) 1672 if (acpi_has_method(dev->acpi_dev->handle, "INFO"))
1678 dev->info_supported = 1; 1673 dev->info_supported = 1;
1679 else { 1674 else {
1680 hci_write1(dev, HCI_SYSTEM_EVENT, 1, &hci_result); 1675 hci_result = hci_write1(dev, HCI_SYSTEM_EVENT, 1);
1681 if (hci_result == TOS_SUCCESS) 1676 if (hci_result == TOS_SUCCESS)
1682 dev->system_event_supported = 1; 1677 dev->system_event_supported = 1;
1683 } 1678 }
@@ -1700,7 +1695,7 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev)
1700 goto err_remove_filter; 1695 goto err_remove_filter;
1701 } 1696 }
1702 1697
1703 hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE, &hci_result); 1698 hci_result = hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE);
1704 return 0; 1699 return 0;
1705 1700
1706 err_remove_filter: 1701 err_remove_filter:
@@ -1961,7 +1956,7 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1961 toshiba_acpi_report_hotkey(dev, scancode); 1956 toshiba_acpi_report_hotkey(dev, scancode);
1962 } else if (dev->system_event_supported) { 1957 } else if (dev->system_event_supported) {
1963 do { 1958 do {
1964 hci_read1(dev, HCI_SYSTEM_EVENT, &value, &hci_result); 1959 hci_result = hci_read1(dev, HCI_SYSTEM_EVENT, &value);
1965 switch (hci_result) { 1960 switch (hci_result) {
1966 case TOS_SUCCESS: 1961 case TOS_SUCCESS:
1967 toshiba_acpi_report_hotkey(dev, (int)value); 1962 toshiba_acpi_report_hotkey(dev, (int)value);
@@ -1972,8 +1967,8 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
1972 * issue on some machines where system events 1967 * issue on some machines where system events
1973 * sporadically become disabled. 1968 * sporadically become disabled.
1974 */ 1969 */
1975 hci_write1(dev, HCI_SYSTEM_EVENT, 1, 1970 hci_result =
1976 &hci_result); 1971 hci_write1(dev, HCI_SYSTEM_EVENT, 1);
1977 pr_notice("Re-enabled hotkeys\n"); 1972 pr_notice("Re-enabled hotkeys\n");
1978 /* fall through */ 1973 /* fall through */
1979 default: 1974 default:
@@ -1991,7 +1986,7 @@ static int toshiba_acpi_suspend(struct device *device)
1991 u32 result; 1986 u32 result;
1992 1987
1993 if (dev->hotkey_dev) 1988 if (dev->hotkey_dev)
1994 hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_DISABLE, &result); 1989 result = hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_DISABLE);
1995 1990
1996 return 0; 1991 return 0;
1997} 1992}
@@ -2008,7 +2003,7 @@ static int toshiba_acpi_resume(struct device *device)
2008 if (ACPI_FAILURE(status)) 2003 if (ACPI_FAILURE(status))
2009 pr_info("Unable to re-enable hotkeys\n"); 2004 pr_info("Unable to re-enable hotkeys\n");
2010 2005
2011 hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE, &result); 2006 result = hci_write1(dev, HCI_HOTKEY_EVENT, HCI_HOTKEY_ENABLE);
2012 } 2007 }
2013 2008
2014 return 0; 2009 return 0;