aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/hp-wmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/hp-wmi.c')
-rw-r--r--drivers/platform/x86/hp-wmi.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 1bc4a7539ba9..f94017bcdd6e 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -24,6 +24,8 @@
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */ 25 */
26 26
27#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/module.h> 30#include <linux/module.h>
29#include <linux/init.h> 31#include <linux/init.h>
@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
54#define HPWMI_HOTKEY_QUERY 0xc 56#define HPWMI_HOTKEY_QUERY 0xc
55#define HPWMI_WIRELESS2_QUERY 0x1b 57#define HPWMI_WIRELESS2_QUERY 0x1b
56 58
57#define PREFIX "HP WMI: "
58#define UNIMP "Unimplemented "
59
60enum hp_wmi_radio { 59enum hp_wmi_radio {
61 HPWMI_WIFI = 0, 60 HPWMI_WIFI = 0,
62 HPWMI_BLUETOOTH = 1, 61 HPWMI_BLUETOOTH = 1,
@@ -228,9 +227,8 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
228 227
229 if (bios_return->return_code) { 228 if (bios_return->return_code) {
230 if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE) 229 if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE)
231 printk(KERN_WARNING PREFIX "query 0x%x returned " 230 pr_warn("query 0x%x returned error 0x%x\n",
232 "error 0x%x\n", 231 query, bios_return->return_code);
233 query, bios_return->return_code);
234 kfree(obj); 232 kfree(obj);
235 return bios_return->return_code; 233 return bios_return->return_code;
236 } 234 }
@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void)
384 382
385 if (num >= state.count || 383 if (num >= state.count ||
386 devstate->rfkill_id != rfkill2[i].id) { 384 devstate->rfkill_id != rfkill2[i].id) {
387 printk(KERN_WARNING PREFIX "power configuration of " 385 pr_warn("power configuration of the wireless devices unexpectedly changed\n");
388 "the wireless devices unexpectedly changed\n");
389 continue; 386 continue;
390 } 387 }
391 388
@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context)
471 468
472 status = wmi_get_event_data(value, &response); 469 status = wmi_get_event_data(value, &response);
473 if (status != AE_OK) { 470 if (status != AE_OK) {
474 printk(KERN_INFO PREFIX "bad event status 0x%x\n", status); 471 pr_info("bad event status 0x%x\n", status);
475 return; 472 return;
476 } 473 }
477 474
@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context)
480 if (!obj) 477 if (!obj)
481 return; 478 return;
482 if (obj->type != ACPI_TYPE_BUFFER) { 479 if (obj->type != ACPI_TYPE_BUFFER) {
483 printk(KERN_INFO "hp-wmi: Unknown response received %d\n", 480 pr_info("Unknown response received %d\n", obj->type);
484 obj->type);
485 kfree(obj); 481 kfree(obj);
486 return; 482 return;
487 } 483 }
@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context)
498 event_id = *location; 494 event_id = *location;
499 event_data = *(location + 2); 495 event_data = *(location + 2);
500 } else { 496 } else {
501 printk(KERN_INFO "hp-wmi: Unknown buffer length %d\n", 497 pr_info("Unknown buffer length %d\n", obj->buffer.length);
502 obj->buffer.length);
503 kfree(obj); 498 kfree(obj);
504 return; 499 return;
505 } 500 }
@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context)
527 522
528 if (!sparse_keymap_report_event(hp_wmi_input_dev, 523 if (!sparse_keymap_report_event(hp_wmi_input_dev,
529 key_code, 1, true)) 524 key_code, 1, true))
530 printk(KERN_INFO PREFIX "Unknown key code - 0x%x\n", 525 pr_info("Unknown key code - 0x%x\n", key_code);
531 key_code);
532 break; 526 break;
533 case HPWMI_WIRELESS: 527 case HPWMI_WIRELESS:
534 if (rfkill2_count) { 528 if (rfkill2_count) {
@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context)
550 hp_wmi_get_hw_state(HPWMI_WWAN)); 544 hp_wmi_get_hw_state(HPWMI_WWAN));
551 break; 545 break;
552 case HPWMI_CPU_BATTERY_THROTTLE: 546 case HPWMI_CPU_BATTERY_THROTTLE:
553 printk(KERN_INFO PREFIX UNIMP "CPU throttle because of 3 Cell" 547 pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n");
554 " battery event detected\n");
555 break; 548 break;
556 case HPWMI_LOCK_SWITCH: 549 case HPWMI_LOCK_SWITCH:
557 break; 550 break;
558 default: 551 default:
559 printk(KERN_INFO PREFIX "Unknown event_id - %d - 0x%x\n", 552 pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
560 event_id, event_data);
561 break; 553 break;
562 } 554 }
563} 555}
@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
705 return err; 697 return err;
706 698
707 if (state.count > HPWMI_MAX_RFKILL2_DEVICES) { 699 if (state.count > HPWMI_MAX_RFKILL2_DEVICES) {
708 printk(KERN_WARNING PREFIX "unable to parse 0x1b query output\n"); 700 pr_warn("unable to parse 0x1b query output\n");
709 return -EINVAL; 701 return -EINVAL;
710 } 702 }
711 703
@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
727 name = "hp-wwan"; 719 name = "hp-wwan";
728 break; 720 break;
729 default: 721 default:
730 printk(KERN_WARNING PREFIX "unknown device type 0x%x\n", 722 pr_warn("unknown device type 0x%x\n",
731 state.device[i].radio_type); 723 state.device[i].radio_type);
732 continue; 724 continue;
733 } 725 }
734 726
735 if (!state.device[i].vendor_id) { 727 if (!state.device[i].vendor_id) {
736 printk(KERN_WARNING PREFIX "zero device %d while %d " 728 pr_warn("zero device %d while %d reported\n",
737 "reported\n", i, state.count); 729 i, state.count);
738 continue; 730 continue;
739 } 731 }
740 732
@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
755 IS_HWBLOCKED(state.device[i].power)); 747 IS_HWBLOCKED(state.device[i].power));
756 748
757 if (!(state.device[i].power & HPWMI_POWER_BIOS)) 749 if (!(state.device[i].power & HPWMI_POWER_BIOS))
758 printk(KERN_INFO PREFIX "device %s blocked by BIOS\n", 750 pr_info("device %s blocked by BIOS\n", name);
759 name);
760 751
761 err = rfkill_register(rfkill); 752 err = rfkill_register(rfkill);
762 if (err) { 753 if (err) {