aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/Kconfig8
-rw-r--r--drivers/platform/x86/Makefile2
-rw-r--r--drivers/platform/x86/asus-nb-wmi.c9
-rw-r--r--drivers/platform/x86/dell-wmi-aio.c53
-rw-r--r--drivers/platform/x86/hp-wmi.c24
-rw-r--r--drivers/platform/x86/hp_accel.c3
-rw-r--r--drivers/platform/x86/ideapad-laptop.c6
-rw-r--r--drivers/platform/x86/pvpanic.c124
-rw-r--r--drivers/platform/x86/samsung-q10.c5
-rw-r--r--drivers/platform/x86/sony-laptop.c20
10 files changed, 242 insertions, 12 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 3338437b559b..85772616efbf 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -781,4 +781,12 @@ config APPLE_GMUX
781 graphics as well as the backlight. Currently only backlight 781 graphics as well as the backlight. Currently only backlight
782 control is supported by the driver. 782 control is supported by the driver.
783 783
784config PVPANIC
785 tristate "pvpanic device support"
786 depends on ACPI
787 ---help---
788 This driver provides support for the pvpanic device. pvpanic is
789 a paravirtualized device provided by QEMU; it lets a virtual machine
790 (guest) communicate panic events to the host.
791
784endif # X86_PLATFORM_DEVICES 792endif # X86_PLATFORM_DEVICES
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index ace2b38942fe..ef0ec746f78c 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -51,3 +51,5 @@ obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
51obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o 51obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o
52obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o 52obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o
53obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o 53obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o
54
55obj-$(CONFIG_PVPANIC) += pvpanic.o
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c
index 210b5b872125..8fcb41e18b9c 100644
--- a/drivers/platform/x86/asus-nb-wmi.c
+++ b/drivers/platform/x86/asus-nb-wmi.c
@@ -171,6 +171,15 @@ static struct dmi_system_id asus_quirks[] = {
171 }, 171 },
172 .driver_data = &quirk_asus_x401u, 172 .driver_data = &quirk_asus_x401u,
173 }, 173 },
174 {
175 .callback = dmi_matched,
176 .ident = "ASUSTeK COMPUTER INC. X75A",
177 .matches = {
178 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
179 DMI_MATCH(DMI_PRODUCT_NAME, "X75A"),
180 },
181 .driver_data = &quirk_asus_x401u,
182 },
174 {}, 183 {},
175}; 184};
176 185
diff --git a/drivers/platform/x86/dell-wmi-aio.c b/drivers/platform/x86/dell-wmi-aio.c
index 3f945457f71c..bcf8cc6b5537 100644
--- a/drivers/platform/x86/dell-wmi-aio.c
+++ b/drivers/platform/x86/dell-wmi-aio.c
@@ -34,6 +34,14 @@ MODULE_LICENSE("GPL");
34#define EVENT_GUID1 "284A0E6B-380E-472A-921F-E52786257FB4" 34#define EVENT_GUID1 "284A0E6B-380E-472A-921F-E52786257FB4"
35#define EVENT_GUID2 "02314822-307C-4F66-BF0E-48AEAEB26CC8" 35#define EVENT_GUID2 "02314822-307C-4F66-BF0E-48AEAEB26CC8"
36 36
37struct dell_wmi_event {
38 u16 length;
39 /* 0x000: A hot key pressed or an event occurred
40 * 0x00F: A sequence of hot keys are pressed */
41 u16 type;
42 u16 event[];
43};
44
37static const char *dell_wmi_aio_guids[] = { 45static const char *dell_wmi_aio_guids[] = {
38 EVENT_GUID1, 46 EVENT_GUID1,
39 EVENT_GUID2, 47 EVENT_GUID2,
@@ -46,15 +54,41 @@ MODULE_ALIAS("wmi:"EVENT_GUID2);
46static const struct key_entry dell_wmi_aio_keymap[] = { 54static const struct key_entry dell_wmi_aio_keymap[] = {
47 { KE_KEY, 0xc0, { KEY_VOLUMEUP } }, 55 { KE_KEY, 0xc0, { KEY_VOLUMEUP } },
48 { KE_KEY, 0xc1, { KEY_VOLUMEDOWN } }, 56 { KE_KEY, 0xc1, { KEY_VOLUMEDOWN } },
57 { KE_KEY, 0xe030, { KEY_VOLUMEUP } },
58 { KE_KEY, 0xe02e, { KEY_VOLUMEDOWN } },
59 { KE_KEY, 0xe020, { KEY_MUTE } },
60 { KE_KEY, 0xe027, { KEY_DISPLAYTOGGLE } },
61 { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } },
62 { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } },
63 { KE_KEY, 0xe00b, { KEY_SWITCHVIDEOMODE } },
49 { KE_END, 0 } 64 { KE_END, 0 }
50}; 65};
51 66
52static struct input_dev *dell_wmi_aio_input_dev; 67static struct input_dev *dell_wmi_aio_input_dev;
53 68
69/*
70 * The new WMI event data format will follow the dell_wmi_event structure
71 * So, we will check if the buffer matches the format
72 */
73static bool dell_wmi_aio_event_check(u8 *buffer, int length)
74{
75 struct dell_wmi_event *event = (struct dell_wmi_event *)buffer;
76
77 if (event == NULL || length < 6)
78 return false;
79
80 if ((event->type == 0 || event->type == 0xf) &&
81 event->length >= 2)
82 return true;
83
84 return false;
85}
86
54static void dell_wmi_aio_notify(u32 value, void *context) 87static void dell_wmi_aio_notify(u32 value, void *context)
55{ 88{
56 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 89 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
57 union acpi_object *obj; 90 union acpi_object *obj;
91 struct dell_wmi_event *event;
58 acpi_status status; 92 acpi_status status;
59 93
60 status = wmi_get_event_data(value, &response); 94 status = wmi_get_event_data(value, &response);
@@ -65,7 +99,7 @@ static void dell_wmi_aio_notify(u32 value, void *context)
65 99
66 obj = (union acpi_object *)response.pointer; 100 obj = (union acpi_object *)response.pointer;
67 if (obj) { 101 if (obj) {
68 unsigned int scancode; 102 unsigned int scancode = 0;
69 103
70 switch (obj->type) { 104 switch (obj->type) {
71 case ACPI_TYPE_INTEGER: 105 case ACPI_TYPE_INTEGER:
@@ -75,13 +109,22 @@ static void dell_wmi_aio_notify(u32 value, void *context)
75 scancode, 1, true); 109 scancode, 1, true);
76 break; 110 break;
77 case ACPI_TYPE_BUFFER: 111 case ACPI_TYPE_BUFFER:
78 /* Broken machines return the scancode in a buffer */ 112 if (dell_wmi_aio_event_check(obj->buffer.pointer,
79 if (obj->buffer.pointer && obj->buffer.length > 0) { 113 obj->buffer.length)) {
80 scancode = obj->buffer.pointer[0]; 114 event = (struct dell_wmi_event *)
115 obj->buffer.pointer;
116 scancode = event->event[0];
117 } else {
118 /* Broken machines return the scancode in a
119 buffer */
120 if (obj->buffer.pointer &&
121 obj->buffer.length > 0)
122 scancode = obj->buffer.pointer[0];
123 }
124 if (scancode)
81 sparse_keymap_report_event( 125 sparse_keymap_report_event(
82 dell_wmi_aio_input_dev, 126 dell_wmi_aio_input_dev,
83 scancode, 1, true); 127 scancode, 1, true);
84 }
85 break; 128 break;
86 } 129 }
87 } 130 }
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 1a779bbfb87d..8df0c5a21be2 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -71,6 +71,14 @@ enum hp_wmi_event_ids {
71 HPWMI_WIRELESS = 5, 71 HPWMI_WIRELESS = 5,
72 HPWMI_CPU_BATTERY_THROTTLE = 6, 72 HPWMI_CPU_BATTERY_THROTTLE = 6,
73 HPWMI_LOCK_SWITCH = 7, 73 HPWMI_LOCK_SWITCH = 7,
74 HPWMI_LID_SWITCH = 8,
75 HPWMI_SCREEN_ROTATION = 9,
76 HPWMI_COOLSENSE_SYSTEM_MOBILE = 0x0A,
77 HPWMI_COOLSENSE_SYSTEM_HOT = 0x0B,
78 HPWMI_PROXIMITY_SENSOR = 0x0C,
79 HPWMI_BACKLIT_KB_BRIGHTNESS = 0x0D,
80 HPWMI_PEAKSHIFT_PERIOD = 0x0F,
81 HPWMI_BATTERY_CHARGE_PERIOD = 0x10,
74}; 82};
75 83
76struct bios_args { 84struct bios_args {
@@ -536,6 +544,22 @@ static void hp_wmi_notify(u32 value, void *context)
536 break; 544 break;
537 case HPWMI_LOCK_SWITCH: 545 case HPWMI_LOCK_SWITCH:
538 break;