Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

Pull x86 platform drivers from Matthew Garrett:
"Small set of updates, mainly trivial bugfixes and some small updates
to deal with newer hardware.

There's also a new driver that allows qemu guests to notify the
hypervisor that they've just paniced, which seems useful."

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
Add support for fan button on Ideapad Z580
pvpanic: pvpanic device driver
asus-nb-wmi: set wapf=4 for ASUSTeK COMPUTER INC. X75A
drivers: platform: x86: Use PTR_RET function
sony-laptop: SVS151290S kbd backlight and gfx switch support
hp-wmi: add more definitions for new event_id's
dell-laptop: Fix krealloc() misuse in parse_da_table()
hp_accel: Ignore the error from lis3lv02d_poweron() at resume
dell: add new dell WMI format for the AIO machines

+242 -12
+8
drivers/platform/x86/Kconfig
··· 781 781 graphics as well as the backlight. Currently only backlight 782 782 control is supported by the driver. 783 783 784 + config 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 + 784 792 endif # X86_PLATFORM_DEVICES
+2
drivers/platform/x86/Makefile
··· 51 51 obj-$(CONFIG_SAMSUNG_Q10) += samsung-q10.o 52 52 obj-$(CONFIG_APPLE_GMUX) += apple-gmux.o 53 53 obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o 54 + 55 + obj-$(CONFIG_PVPANIC) += pvpanic.o
+9
drivers/platform/x86/asus-nb-wmi.c
··· 171 171 }, 172 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
+48 -5
drivers/platform/x86/dell-wmi-aio.c
··· 34 34 #define EVENT_GUID1 "284A0E6B-380E-472A-921F-E52786257FB4" 35 35 #define EVENT_GUID2 "02314822-307C-4F66-BF0E-48AEAEB26CC8" 36 36 37 + struct 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 + 37 45 static const char *dell_wmi_aio_guids[] = { 38 46 EVENT_GUID1, 39 47 EVENT_GUID2, ··· 54 46 static const struct key_entry dell_wmi_aio_keymap[] = { 55 47 { KE_KEY, 0xc0, { KEY_VOLUMEUP } }, 56 48 { KE_KEY, 0xc1, { KEY_VOLUMEDOWN } }, 49 + { KE_KEY, 0xe030, { KEY_VOLUMEUP } }, 50 + { KE_KEY, 0xe02e, { KEY_VOLUMEDOWN } }, 51 + { KE_KEY, 0xe020, { KEY_MUTE } }, 52 + { KE_KEY, 0xe027, { KEY_DISPLAYTOGGLE } }, 53 + { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } }, 54 + { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } }, 55 + { KE_KEY, 0xe00b, { KEY_SWITCHVIDEOMODE } }, 57 56 { KE_END, 0 } 58 57 }; 59 58 60 59 static struct input_dev *dell_wmi_aio_input_dev; 61 60 61 + /* 62 + * The new WMI event data format will follow the dell_wmi_event structure 63 + * So, we will check if the buffer matches the format 64 + */ 65 + static bool dell_wmi_aio_event_check(u8 *buffer, int length) 66 + { 67 + struct dell_wmi_event *event = (struct dell_wmi_event *)buffer; 68 + 69 + if (event == NULL || length < 6) 70 + return false; 71 + 72 + if ((event->type == 0 || event->type == 0xf) && 73 + event->length >= 2) 74 + return true; 75 + 76 + return false; 77 + } 78 + 62 79 static void dell_wmi_aio_notify(u32 value, void *context) 63 80 { 64 81 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 65 82 union acpi_object *obj; 83 + struct dell_wmi_event *event; 66 84 acpi_status status; 67 85 68 86 status = wmi_get_event_data(value, &response); ··· 99 65 100 66 obj = (union acpi_object *)response.pointer; 101 67 if (obj) { 102 - unsigned int scancode; 68 + unsigned int scancode = 0; 103 69 104 70 switch (obj->type) { 105 71 case ACPI_TYPE_INTEGER: ··· 109 75 scancode, 1, true); 110 76 break; 111 77 case ACPI_TYPE_BUFFER: 112 - /* Broken machines return the scancode in a buffer */ 113 - if (obj->buffer.pointer && obj->buffer.length > 0) { 114 - scancode = obj->buffer.pointer[0]; 78 + if (dell_wmi_aio_event_check(obj->buffer.pointer, 79 + obj->buffer.length)) { 80 + event = (struct dell_wmi_event *) 81 + obj->buffer.pointer; 82 + scancode = event->event[0]; 83 + } else { 84 + /* Broken machines return the scancode in a 85 + buffer */ 86 + if (obj->buffer.pointer && 87 + obj->buffer.length > 0) 88 + scancode = obj->buffer.pointer[0]; 89 + } 90 + if (scancode) 115 91 sparse_keymap_report_event( 116 92 dell_wmi_aio_input_dev, 117 93 scancode, 1, true); 118 - } 119 94 break; 120 95 } 121 96 }
+24
drivers/platform/x86/hp-wmi.c
··· 71 71 HPWMI_WIRELESS = 5, 72 72 HPWMI_CPU_BATTERY_THROTTLE = 6, 73 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 76 84 struct bios_args { ··· 543 535 pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n"); 544 536 break; 545 537 case HPWMI_LOCK_SWITCH: 538 + break; 539 + case HPWMI_LID_SWITCH: 540 + break; 541 + case HPWMI_SCREEN_ROTATION: 542 + break; 543 + case HPWMI_COOLSENSE_SYSTEM_MOBILE: 544 + break; 545 + case HPWMI_COOLSENSE_SYSTEM_HOT: 546 + break; 547 + case HPWMI_PROXIMITY_SENSOR: 548 + break; 549 + case HPWMI_BACKLIT_KB_BRIGHTNESS: 550 + break; 551 + case HPWMI_PEAKSHIFT_PERIOD: 552 + break; 553 + case HPWMI_BATTERY_CHARGE_PERIOD: 546 554 break; 547 555 default: 548 556 pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
+2 -1
drivers/platform/x86/hp_accel.c
··· 362 362 363 363 static int lis3lv02d_resume(struct device *dev) 364 364 { 365 - return lis3lv02d_poweron(&lis3_dev); 365 + lis3lv02d_poweron(&lis3_dev); 366 + return 0; 366 367 } 367 368 368 369 static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
+5 -1
drivers/platform/x86/ideapad-laptop.c
··· 640 640 for (bit = 0; bit < 16; bit++) { 641 641 if (test_bit(bit, &value)) { 642 642 switch (bit) { 643 - case 6: 643 + case 0: /* Z580 */ 644 + case 6: /* Z570 */ 644 645 /* Thermal Management button */ 645 646 ideapad_input_report(priv, 65); 646 647 break; 647 648 case 1: 648 649 /* OneKey Theater button */ 649 650 ideapad_input_report(priv, 64); 651 + break; 652 + default: 653 + pr_info("Unknown special button: %lu\n", bit); 650 654 break; 651 655 } 652 656 }
+124
drivers/platform/x86/pvpanic.c
··· 1 + /* 2 + * pvpanic.c - pvpanic Device Support 3 + * 4 + * Copyright (C) 2013 Fujitsu. 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with this program; if not, write to the Free Software 18 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 + */ 20 + 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 23 + #include <linux/kernel.h> 24 + #include <linux/module.h> 25 + #include <linux/init.h> 26 + #include <linux/types.h> 27 + #include <acpi/acpi_bus.h> 28 + #include <acpi/acpi_drivers.h> 29 + 30 + MODULE_AUTHOR("Hu Tao <hutao@cn.fujitsu.com>"); 31 + MODULE_DESCRIPTION("pvpanic device driver"); 32 + MODULE_LICENSE("GPL"); 33 + 34 + static int pvpanic_add(struct acpi_device *device); 35 + static int pvpanic_remove(struct acpi_device *device); 36 + 37 + static const struct acpi_device_id pvpanic_device_ids[] = { 38 + { "QEMU0001", 0 }, 39 + { "", 0 }, 40 + }; 41 + MODULE_DEVICE_TABLE(acpi, pvpanic_device_ids); 42 + 43 + #define PVPANIC_PANICKED (1 << 0) 44 + 45 + static u16 port; 46 + 47 + static struct acpi_driver pvpanic_driver = { 48 + .name = "pvpanic", 49 + .class = "QEMU", 50 + .ids = pvpanic_device_ids, 51 + .ops = { 52 + .add = pvpanic_add, 53 + .remove = pvpanic_remove, 54 + }, 55 + .owner = THIS_MODULE, 56 + }; 57 + 58 + static void 59 + pvpanic_send_event(unsigned int event) 60 + { 61 + outb(event, port); 62 + } 63 + 64 + static int 65 + pvpanic_panic_notify(struct notifier_block *nb, unsigned long code, 66 + void *unused) 67 + { 68 + pvpanic_send_event(PVPANIC_PANICKED); 69 + return NOTIFY_DONE; 70 + } 71 + 72 + static struct notifier_block pvpanic_panic_nb = { 73 + .notifier_call = pvpanic_panic_notify, 74 + }; 75 + 76 + 77 + static acpi_status 78 + pvpanic_walk_resources(struct acpi_resource *res, void *context) 79 + { 80 + switch (res->type) { 81 + case ACPI_RESOURCE_TYPE_END_TAG: 82 + return AE_OK; 83 + 84 + case ACPI_RESOURCE_TYPE_IO: 85 + port = res->data.io.minimum; 86 + return AE_OK; 87 + 88 + default: 89 + return AE_ERROR; 90 + } 91 + } 92 + 93 + static int pvpanic_add(struct acpi_device *device) 94 + { 95 + acpi_status status; 96 + u64 ret; 97 + 98 + status = acpi_evaluate_integer(device->handle, "_STA", NULL, 99 + &ret); 100 + 101 + if (ACPI_FAILURE(status) || (ret & 0x0B) != 0x0B) 102 + return -ENODEV; 103 + 104 + acpi_walk_resources(device->handle, METHOD_NAME__CRS, 105 + pvpanic_walk_resources, NULL); 106 + 107 + if (!port) 108 + return -ENODEV; 109 + 110 + atomic_notifier_chain_register(&panic_notifier_list, 111 + &pvpanic_panic_nb); 112 + 113 + return 0; 114 + } 115 + 116 + static int pvpanic_remove(struct acpi_device *device) 117 + { 118 + 119 + atomic_notifier_chain_unregister(&panic_notifier_list, 120 + &pvpanic_panic_nb); 121 + return 0; 122 + } 123 + 124 + module_acpi_driver(pvpanic_driver);
+1 -4
drivers/platform/x86/samsung-q10.c
··· 176 176 samsungq10_probe, 177 177 NULL, 0, NULL, 0); 178 178 179 - if (IS_ERR(samsungq10_device)) 180 - return PTR_ERR(samsungq10_device); 181 - 182 - return 0; 179 + return PTR_RET(samsungq10_device); 183 180 } 184 181 185 182 static void __exit samsungq10_exit(void)
+19 -1
drivers/platform/x86/sony-laptop.c
··· 1255 1255 real_ev = __sony_nc_gfx_switch_status_get(); 1256 1256 break; 1257 1257 1258 + case 0x015B: 1259 + /* Hybrid GFX switching SVS151290S */ 1260 + ev_type = GFX_SWITCH; 1261 + real_ev = __sony_nc_gfx_switch_status_get(); 1262 + break; 1258 1263 default: 1259 1264 dprintk("Unknown event 0x%x for handle 0x%x\n", 1260 1265 event, handle); ··· 1358 1353 break; 1359 1354 case 0x0128: 1360 1355 case 0x0146: 1356 + case 0x015B: 1361 1357 result = sony_nc_gfx_switch_setup(pf_device, handle); 1362 1358 if (result) 1363 1359 pr_err("couldn't set up GFX Switch status (%d)\n", ··· 1381 1375 case 0x0143: 1382 1376 case 0x014b: 1383 1377 case 0x014c: 1378 + case 0x0163: 1384 1379 result = sony_nc_kbd_backlight_setup(pf_device, handle); 1385 1380 if (result) 1386 1381 pr_err("couldn't set up keyboard backlight function (%d)\n", ··· 1433 1426 break; 1434 1427 case 0x0128: 1435 1428 case 0x0146: 1429 + case 0x015B: 1436 1430 sony_nc_gfx_switch_cleanup(pd); 1437 1431 break; 1438 1432 case 0x0131: ··· 1447 1439 case 0x0143: 1448 1440 case 0x014b: 1449 1441 case 0x014c: 1442 + case 0x0163: 1450 1443 sony_nc_kbd_backlight_cleanup(pd); 1451 1444 break; 1452 1445 default: ··· 1494 1485 case 0x0143: 1495 1486 case 0x014b: 1496 1487 case 0x014c: 1488 + case 0x0163: 1497 1489 sony_nc_kbd_backlight_resume(); 1498 1490 break; 1499 1491 default: ··· 2400 2390 { 2401 2391 unsigned int result; 2402 2392 2403 - if (sony_call_snc_handle(gfxs_ctl->handle, 0x0100, &result)) 2393 + if (sony_call_snc_handle(gfxs_ctl->handle, 2394 + gfxs_ctl->handle == 0x015B ? 0x0000 : 0x0100, 2395 + &result)) 2404 2396 return -EIO; 2405 2397 2406 2398 switch (gfxs_ctl->handle) { ··· 2411 2399 * 0: integrated GFX (stamina) 2412 2400 */ 2413 2401 return result & 0x1 ? SPEED : STAMINA; 2402 + break; 2403 + case 0x015B: 2404 + /* 0: discrete GFX (speed) 2405 + * 1: integrated GFX (stamina) 2406 + */ 2407 + return result & 0x1 ? STAMINA : SPEED; 2414 2408 break; 2415 2409 case 0x0128: 2416 2410 /* it's a more elaborated bitmask, for now: