diff options
| -rw-r--r-- | drivers/platform/x86/toshiba_acpi.c | 59 | ||||
| -rw-r--r-- | drivers/platform/x86/toshiba_bluetooth.c | 11 |
2 files changed, 34 insertions, 36 deletions
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 63f42a22e102..cb009b2629ee 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 39 | |||
| 38 | #define TOSHIBA_ACPI_VERSION "0.19" | 40 | #define TOSHIBA_ACPI_VERSION "0.19" |
| 39 | #define PROC_INTERFACE_VERSION 1 | 41 | #define PROC_INTERFACE_VERSION 1 |
| 40 | 42 | ||
| @@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte"); | |||
| 60 | MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); | 62 | MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); |
| 61 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
| 62 | 64 | ||
| 63 | #define MY_LOGPREFIX "toshiba_acpi: " | ||
| 64 | #define MY_ERR KERN_ERR MY_LOGPREFIX | ||
| 65 | #define MY_NOTICE KERN_NOTICE MY_LOGPREFIX | ||
| 66 | #define MY_INFO KERN_INFO MY_LOGPREFIX | ||
| 67 | |||
| 68 | /* Toshiba ACPI method paths */ | 65 | /* Toshiba ACPI method paths */ |
| 69 | #define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM" | 66 | #define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM" |
| 70 | #define TOSH_INTERFACE_1 "\\_SB_.VALD" | 67 | #define TOSH_INTERFACE_1 "\\_SB_.VALD" |
| @@ -301,7 +298,7 @@ static int toshiba_illumination_available(void) | |||
| 301 | in[0] = 0xf100; | 298 | in[0] = 0xf100; |
| 302 | status = hci_raw(in, out); | 299 | status = hci_raw(in, out); |
| 303 | if (ACPI_FAILURE(status)) { | 300 | if (ACPI_FAILURE(status)) { |
| 304 | printk(MY_INFO "Illumination device not available\n"); | 301 | pr_info("Illumination device not available\n"); |
| 305 | return 0; | 302 | return 0; |
| 306 | } | 303 | } |
| 307 | in[0] = 0xf400; | 304 | in[0] = 0xf400; |
| @@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, | |||
| 320 | in[0] = 0xf100; | 317 | in[0] = 0xf100; |
| 321 | status = hci_raw(in, out); | 318 | status = hci_raw(in, out); |
| 322 | if (ACPI_FAILURE(status)) { | 319 | if (ACPI_FAILURE(status)) { |
| 323 | printk(MY_INFO "Illumination device not available\n"); | 320 | pr_info("Illumination device not available\n"); |
| 324 | return; | 321 | return; |
| 325 | } | 322 | } |
| 326 | 323 | ||
| @@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, | |||
| 331 | in[2] = 1; | 328 | in[2] = 1; |
| 332 | status = hci_raw(in, out); | 329 | status = hci_raw(in, out); |
| 333 | if (ACPI_FAILURE(status)) { | 330 | if (ACPI_FAILURE(status)) { |
| 334 | printk(MY_INFO "ACPI call for illumination failed.\n"); | 331 | pr_info("ACPI call for illumination failed\n"); |
| 335 | return; | 332 | return; |
| 336 | } | 333 | } |
| 337 | } else { | 334 | } else { |
| @@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, | |||
| 341 | in[2] = 0; | 338 | in[2] = 0; |
| 342 | status = hci_raw(in, out); | 339 | status = hci_raw(in, out); |
| 343 | if (ACPI_FAILURE(status)) { | 340 | if (ACPI_FAILURE(status)) { |
| 344 | printk(MY_INFO "ACPI call for illumination failed.\n"); | 341 | pr_info("ACPI call for illumination failed.\n"); |
| 345 | return; | 342 | return; |
| 346 | } | 343 | } |
| 347 | } | 344 | } |
| @@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev) | |||
| 364 | in[0] = 0xf100; | 361 | in[0] = 0xf100; |
| 365 | status = hci_raw(in, out); | 362 | status = hci_raw(in, out); |
| 366 | if (ACPI_FAILURE(status)) { | 363 | if (ACPI_FAILURE(status)) { |
| 367 | printk(MY_INFO "Illumination device not available\n"); | 364 | pr_info("Illumination device not available\n"); |
| 368 | return LED_OFF; | 365 | return LED_OFF; |
| 369 | } | 366 | } |
| 370 | 367 | ||
| @@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev) | |||
| 373 | in[1] = 0x14e; | 370 | in[1] = 0x14e; |
| 374 | status = hci_raw(in, out); | 371 | status = hci_raw(in, out); |
| 375 | if (ACPI_FAILURE(status)) { | 372 | if (ACPI_FAILURE(status)) { |
| 376 | printk(MY_INFO "ACPI call for illumination failed.\n"); | 373 | pr_info("ACPI call for illumination failed.\n"); |
| 377 | return LED_OFF; | 374 | return LED_OFF; |
| 378 | } | 375 | } |
| 379 | 376 | ||
| @@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v) | |||
| 517 | seq_printf(m, "brightness_levels: %d\n", | 514 | seq_printf(m, "brightness_levels: %d\n", |
| 518 | HCI_LCD_BRIGHTNESS_LEVELS); | 515 | HCI_LCD_BRIGHTNESS_LEVELS); |
| 519 | } else { | 516 | } else { |
| 520 | printk(MY_ERR "Error reading LCD brightness\n"); | 517 | pr_err("Error reading LCD brightness\n"); |
| 521 | } | 518 | } |
| 522 | 519 | ||
| 523 | return 0; | 520 | return 0; |
| @@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v) | |||
| 592 | seq_printf(m, "crt_out: %d\n", is_crt); | 589 | seq_printf(m, "crt_out: %d\n", is_crt); |
| 593 | seq_printf(m, "tv_out: %d\n", is_tv); | 590 | seq_printf(m, "tv_out: %d\n", is_tv); |
| 594 | } else { | 591 | } else { |
| 595 | printk(MY_ERR "Error reading video out status\n"); | 592 | pr_err("Error reading video out status\n"); |
| 596 | } | 593 | } |
| 597 | 594 | ||
| 598 | return 0; | 595 | return 0; |
| @@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v) | |||
| 686 | seq_printf(m, "running: %d\n", (value > 0)); | 683 | seq_printf(m, "running: %d\n", (value > 0)); |
| 687 | seq_printf(m, "force_on: %d\n", force_fan); | 684 | seq_printf(m, "force_on: %d\n", force_fan); |
| 688 | } else { | 685 | } else { |
| 689 | printk(MY_ERR "Error reading fan status\n"); | 686 | pr_err("Error reading fan status\n"); |
| 690 | } | 687 | } |
| 691 | 688 | ||
| 692 | return 0; | 689 | return 0; |
| @@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v) | |||
| 750 | * some machines where system events sporadically | 747 | * some machines where system events sporadically |
| 751 | * become disabled. */ | 748 | * become disabled. */ |
| 752 | hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); | 749 | hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); |
| 753 | printk(MY_NOTICE "Re-enabled hotkeys\n"); | 750 | pr_notice("Re-enabled hotkeys\n"); |
| 754 | } else { | 751 | } else { |
| 755 | printk(MY_ERR "Error reading hotkey status\n"); | 752 | pr_err("Error reading hotkey status\n"); |
| 756 | goto end; | 753 | goto end; |
| 757 | } | 754 | } |
| 758 | } | 755 | } |
| @@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context) | |||
| 863 | 860 | ||
| 864 | if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev, | 861 | if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev, |
| 865 | value, 1, true)) { | 862 | value, 1, true)) { |
| 866 | printk(MY_INFO "Unknown key %x\n", | 863 | pr_info("Unknown key %x\n", |
| 867 | value); | 864 | value); |
| 868 | } | 865 | } |
| 869 | } else if (hci_result == HCI_NOT_SUPPORTED) { | 866 | } else if (hci_result == HCI_NOT_SUPPORTED) { |
| @@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context) | |||
| 871 | * some machines where system events sporadically | 868 | * some machines where system events sporadically |
| 872 | * become disabled. */ | 869 | * become disabled. */ |
| 873 | hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); | 870 | hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); |
| 874 | printk(MY_NOTICE "Re-enabled hotkeys\n"); | 871 | pr_notice("Re-enabled hotkeys\n"); |
| 875 | } | 872 | } |
| 876 | } while (hci_result != HCI_EMPTY); | 873 | } while (hci_result != HCI_EMPTY); |
| 877 | } | 874 | } |
| @@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device) | |||
| 883 | 880 | ||
| 884 | status = acpi_get_handle(NULL, device, &toshiba_acpi.handle); | 881 | status = acpi_get_handle(NULL, device, &toshiba_acpi.handle); |
| 885 | if (ACPI_FAILURE(status)) { | 882 | if (ACPI_FAILURE(status)) { |
| 886 | printk(MY_INFO "Unable to get notification device\n"); | 883 | pr_info("Unable to get notification device\n"); |
| 887 | return -ENODEV; | 884 | return -ENODEV; |
| 888 | } | 885 | } |
| 889 | 886 | ||
| 890 | toshiba_acpi.hotkey_dev = input_allocate_device(); | 887 | toshiba_acpi.hotkey_dev = input_allocate_device(); |
| 891 | if (!toshiba_acpi.hotkey_dev) { | 888 | if (!toshiba_acpi.hotkey_dev) { |
| 892 | printk(MY_INFO "Unable to register input device\n"); | 889 | pr_info("Unable to register input device\n"); |
| 893 | return -ENOMEM; | 890 | return -ENOMEM; |
| 894 | } | 891 | } |
| 895 | 892 | ||
| @@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device) | |||
| 905 | status = acpi_install_notify_handler(toshiba_acpi.handle, | 902 | status = acpi_install_notify_handler(toshiba_acpi.handle, |
| 906 | ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL); | 903 | ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL); |
| 907 | if (ACPI_FAILURE(status)) { | 904 | if (ACPI_FAILURE(status)) { |
| 908 | printk(MY_INFO "Unable to install hotkey notification\n"); | 905 | pr_info("Unable to install hotkey notification\n"); |
| 909 | error = -ENODEV; | 906 | error = -ENODEV; |
| 910 | goto err_free_keymap; | 907 | goto err_free_keymap; |
| 911 | } | 908 | } |
| 912 | 909 | ||
| 913 | status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL); | 910 | status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL); |
| 914 | if (ACPI_FAILURE(status)) { | 911 | if (ACPI_FAILURE(status)) { |
| 915 | printk(MY_INFO "Unable to enable hotkeys\n"); | 912 | pr_info("Unable to enable hotkeys\n"); |
| 916 | error = -ENODEV; | 913 | error = -ENODEV; |
| 917 | goto err_remove_notify; | 914 | goto err_remove_notify; |
| 918 | } | 915 | } |
| 919 | 916 | ||
| 920 | error = input_register_device(toshiba_acpi.hotkey_dev); | 917 | error = input_register_device(toshiba_acpi.hotkey_dev); |
| 921 | if (error) { | 918 | if (error) { |
| 922 | printk(MY_INFO "Unable to register input device\n"); | 919 | pr_info("Unable to register input device\n"); |
| 923 | goto err_remove_notify; | 920 | goto err_remove_notify; |
| 924 | } | 921 | } |
| 925 | 922 | ||
| @@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void) | |||
| 980 | if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) { | 977 | if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) { |
| 981 | method_hci = TOSH_INTERFACE_1 GHCI_METHOD; | 978 | method_hci = TOSH_INTERFACE_1 GHCI_METHOD; |
| 982 | if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1)) | 979 | if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1)) |
| 983 | printk(MY_INFO "Unable to activate hotkeys\n"); | 980 | pr_info("Unable to activate hotkeys\n"); |
| 984 | } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) { | 981 | } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) { |
| 985 | method_hci = TOSH_INTERFACE_2 GHCI_METHOD; | 982 | method_hci = TOSH_INTERFACE_2 GHCI_METHOD; |
| 986 | if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2)) | 983 | if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2)) |
| 987 | printk(MY_INFO "Unable to activate hotkeys\n"); | 984 | pr_info("Unable to activate hotkeys\n"); |
| 988 | } else | 985 | } else |
| 989 | return -ENODEV; | 986 | return -ENODEV; |
| 990 | 987 | ||
| 991 | printk(MY_INFO "Toshiba Laptop ACPI Extras version %s\n", | 988 | pr_info("Toshiba Laptop ACPI Extras version %s\n", |
| 992 | TOSHIBA_ACPI_VERSION); | 989 | TOSHIBA_ACPI_VERSION); |
| 993 | printk(MY_INFO " HCI method: %s\n", method_hci); | 990 | pr_info(" HCI method: %s\n", method_hci); |
| 994 | 991 | ||
| 995 | mutex_init(&toshiba_acpi.mutex); | 992 | mutex_init(&toshiba_acpi.mutex); |
| 996 | 993 | ||
| @@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void) | |||
| 998 | -1, NULL, 0); | 995 | -1, NULL, 0); |
| 999 | if (IS_ERR(toshiba_acpi.p_dev)) { | 996 | if (IS_ERR(toshiba_acpi.p_dev)) { |
| 1000 | ret = PTR_ERR(toshiba_acpi.p_dev); | 997 | ret = PTR_ERR(toshiba_acpi.p_dev); |
| 1001 | printk(MY_ERR "unable to register platform device\n"); | 998 | pr_err("unable to register platform device\n"); |
| 1002 | toshiba_acpi.p_dev = NULL; | 999 | toshiba_acpi.p_dev = NULL; |
| 1003 | toshiba_acpi_exit(); | 1000 | toshiba_acpi_exit(); |
| 1004 | return ret; | 1001 | return ret; |
| @@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void) | |||
| 1028 | if (IS_ERR(toshiba_backlight_device)) { | 1025 | if (IS_ERR(toshiba_backlight_device)) { |
| 1029 | ret = PTR_ERR(toshiba_backlight_device); | 1026 | ret = PTR_ERR(toshiba_backlight_device); |
| 1030 | 1027 | ||
| 1031 | printk(KERN_ERR "Could not register toshiba backlight device\n"); | 1028 | pr_err("Could not register toshiba backlight device\n"); |
| 1032 | toshiba_backlight_device = NULL; | 1029 | toshiba_backlight_device = NULL; |
| 1033 | toshiba_acpi_exit(); | 1030 | toshiba_acpi_exit(); |
| 1034 | return ret; | 1031 | return ret; |
| @@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void) | |||
| 1042 | &toshiba_rfk_ops, | 1039 | &toshiba_rfk_ops, |
| 1043 | &toshiba_acpi); | 1040 | &toshiba_acpi); |
| 1044 | if (!toshiba_acpi.bt_rfk) { | 1041 | if (!toshiba_acpi.bt_rfk) { |
| 1045 | printk(MY_ERR "unable to allocate rfkill device\n"); | 1042 | pr_err("unable to allocate rfkill device\n"); |
| 1046 | toshiba_acpi_exit(); | 1043 | toshiba_acpi_exit(); |
| 1047 | return -ENOMEM; | 1044 | return -ENOMEM; |
| 1048 | } | 1045 | } |
| 1049 | 1046 | ||
| 1050 | ret = rfkill_register(toshiba_acpi.bt_rfk); | 1047 | ret = rfkill_register(toshiba_acpi.bt_rfk); |
| 1051 | if (ret) { | 1048 | if (ret) { |
| 1052 | printk(MY_ERR "unable to register rfkill device\n"); | 1049 | pr_err("unable to register rfkill device\n"); |
| 1053 | rfkill_destroy(toshiba_acpi.bt_rfk); | 1050 | rfkill_destroy(toshiba_acpi.bt_rfk); |
| 1054 | toshiba_acpi_exit(); | 1051 | toshiba_acpi_exit(); |
| 1055 | return ret; | 1052 | return ret; |
diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c index 944068611919..5fb7186694df 100644 --- a/drivers/platform/x86/toshiba_bluetooth.c +++ b/drivers/platform/x86/toshiba_bluetooth.c | |||
| @@ -17,6 +17,8 @@ | |||
| 17 | * delivered. | 17 | * delivered. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 21 | |||
| 20 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 21 | #include <linux/module.h> | 23 | #include <linux/module.h> |
| 22 | #include <linux/init.h> | 24 | #include <linux/init.h> |
| @@ -70,14 +72,13 @@ static int toshiba_bluetooth_enable(acpi_handle handle) | |||
| 70 | if (!(result & 0x01)) | 72 | if (!(result & 0x01)) |
| 71 | return 0; | 73 | return 0; |
| 72 | 74 | ||
| 73 | printk(KERN_INFO "toshiba_bluetooth: Re-enabling Toshiba Bluetooth\n"); | 75 | pr_info("Re-enabling Toshiba Bluetooth\n"); |
| 74 | res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL); | 76 | res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL); |
| 75 | res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL); | 77 | res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL); |
| 76 | if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2)) | 78 | if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2)) |
| 77 | return 0; | 79 | return 0; |
| 78 | 80 | ||
| 79 | printk(KERN_WARNING "toshiba_bluetooth: Failed to re-enable " | 81 | pr_warn("Failed to re-enable Toshiba Bluetooth\n"); |
| 80 | "Toshiba Bluetooth\n"); | ||
| 81 | 82 | ||
| 82 | return -ENODEV; | 83 | return -ENODEV; |
| 83 | } | 84 | } |
| @@ -107,8 +108,8 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device) | |||
| 107 | &bt_present); | 108 | &bt_present); |
| 108 | 109 | ||
| 109 | if (!ACPI_FAILURE(status) && bt_present) { | 110 | if (!ACPI_FAILURE(status) && bt_present) { |
| 110 | printk(KERN_INFO "Detected Toshiba ACPI Bluetooth device - " | 111 | pr_info("Detected Toshiba ACPI Bluetooth device - " |
| 111 | "installing RFKill handler\n"); | 112 | "installing RFKill handler\n"); |
| 112 | result = toshiba_bluetooth_enable(device->handle); | 113 | result = toshiba_bluetooth_enable(device->handle); |
| 113 | } | 114 | } |
| 114 | 115 | ||
