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 tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver fixes from Darren Hart:
"Fix an issue introduced by the previous major toshiba rework. Add a
quirk. Workaround a few platform specific firmware items. One
cleanup to wmi I inadvertently dropped from a previous pull request.

Details:

hp-wmi:
- limit hotkey enable

toshiba_acpi:
- Fix hotkeys registration on some toshiba models
- Fix USB Sleep and Music always disabled

wmi:
- Remove private %pUL implementation

asus-nb-wmi:
- Add wapf=4 quirk for X456UA/X456UF"

* tag 'platform-drivers-x86-v4.3-2' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86:
hp-wmi: limit hotkey enable
toshiba_acpi: Fix hotkeys registration on some toshiba models
toshiba_acpi: Fix USB Sleep and Music always disabled
wmi: Remove private %pUL implementation
asus-nb-wmi: Add wapf=4 quirk for X456UA/X456UF

+48 -62
+18
drivers/platform/x86/asus-nb-wmi.c
··· 128 128 }, 129 129 { 130 130 .callback = dmi_matched, 131 + .ident = "ASUSTeK COMPUTER INC. X456UA", 132 + .matches = { 133 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 134 + DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"), 135 + }, 136 + .driver_data = &quirk_asus_wapf4, 137 + }, 138 + { 139 + .callback = dmi_matched, 140 + .ident = "ASUSTeK COMPUTER INC. X456UF", 141 + .matches = { 142 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 143 + DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"), 144 + }, 145 + .driver_data = &quirk_asus_wapf4, 146 + }, 147 + { 148 + .callback = dmi_matched, 131 149 .ident = "ASUSTeK COMPUTER INC. X501U", 132 150 .matches = { 133 151 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+20 -11
drivers/platform/x86/hp-wmi.c
··· 54 54 #define HPWMI_HARDWARE_QUERY 0x4 55 55 #define HPWMI_WIRELESS_QUERY 0x5 56 56 #define HPWMI_BIOS_QUERY 0x9 57 + #define HPWMI_FEATURE_QUERY 0xb 57 58 #define HPWMI_HOTKEY_QUERY 0xc 58 - #define HPWMI_FEATURE_QUERY 0xd 59 + #define HPWMI_FEATURE2_QUERY 0xd 59 60 #define HPWMI_WIRELESS2_QUERY 0x1b 60 61 #define HPWMI_POSTCODEERROR_QUERY 0x2a 61 62 ··· 296 295 return (state & 0x4) ? 1 : 0; 297 296 } 298 297 299 - static int __init hp_wmi_bios_2009_later(void) 298 + static int __init hp_wmi_bios_2008_later(void) 300 299 { 301 300 int state = 0; 302 301 int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, 0, &state, 303 302 sizeof(state), sizeof(state)); 304 - if (ret) 305 - return ret; 303 + if (!ret) 304 + return 1; 306 305 307 - return (state & 0x10) ? 1 : 0; 306 + return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; 308 307 } 309 308 310 - static int hp_wmi_enable_hotkeys(void) 309 + static int __init hp_wmi_bios_2009_later(void) 311 310 { 312 - int ret; 313 - int query = 0x6e; 311 + int state = 0; 312 + int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, 0, &state, 313 + sizeof(state), sizeof(state)); 314 + if (!ret) 315 + return 1; 314 316 315 - ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &query, sizeof(query), 316 - 0); 317 + return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; 318 + } 317 319 320 + static int __init hp_wmi_enable_hotkeys(void) 321 + { 322 + int value = 0x6e; 323 + int ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &value, 324 + sizeof(value), 0); 318 325 if (ret) 319 326 return -EINVAL; 320 327 return 0; ··· 672 663 hp_wmi_tablet_state()); 673 664 input_sync(hp_wmi_input_dev); 674 665 675 - if (hp_wmi_bios_2009_later() == 4) 666 + if (!hp_wmi_bios_2009_later() && hp_wmi_bios_2008_later()) 676 667 hp_wmi_enable_hotkeys(); 677 668 678 669 status = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL);
+4 -6
drivers/platform/x86/toshiba_acpi.c
··· 938 938 else if (result == TOS_NOT_SUPPORTED) 939 939 return -ENODEV; 940 940 941 - return result = TOS_SUCCESS ? 0 : -EIO; 941 + return result == TOS_SUCCESS ? 0 : -EIO; 942 942 } 943 943 944 944 static int toshiba_usb_sleep_music_set(struct toshiba_acpi_dev *dev, u32 state) ··· 2398 2398 if (error) 2399 2399 return error; 2400 2400 2401 - error = toshiba_hotkey_event_type_get(dev, &events_type); 2402 - if (error) { 2403 - pr_err("Unable to query Hotkey Event Type\n"); 2404 - return error; 2405 - } 2401 + if (toshiba_hotkey_event_type_get(dev, &events_type)) 2402 + pr_notice("Unable to query Hotkey Event Type\n"); 2403 + 2406 2404 dev->hotkey_event_type = events_type; 2407 2405 2408 2406 dev->hotkey_dev = input_allocate_device();
+6 -45
drivers/platform/x86/wmi.c
··· 194 194 return true; 195 195 } 196 196 197 - /* 198 - * Convert a raw GUID to the ACII string representation 199 - */ 200 - static int wmi_gtoa(const char *in, char *out) 201 - { 202 - int i; 203 - 204 - for (i = 3; i >= 0; i--) 205 - out += sprintf(out, "%02X", in[i] & 0xFF); 206 - 207 - out += sprintf(out, "-"); 208 - out += sprintf(out, "%02X", in[5] & 0xFF); 209 - out += sprintf(out, "%02X", in[4] & 0xFF); 210 - out += sprintf(out, "-"); 211 - out += sprintf(out, "%02X", in[7] & 0xFF); 212 - out += sprintf(out, "%02X", in[6] & 0xFF); 213 - out += sprintf(out, "-"); 214 - out += sprintf(out, "%02X", in[8] & 0xFF); 215 - out += sprintf(out, "%02X", in[9] & 0xFF); 216 - out += sprintf(out, "-"); 217 - 218 - for (i = 10; i <= 15; i++) 219 - out += sprintf(out, "%02X", in[i] & 0xFF); 220 - 221 - *out = '\0'; 222 - return 0; 223 - } 224 - 225 197 static bool find_guid(const char *guid_string, struct wmi_block **out) 226 198 { 227 199 char tmp[16], guid_input[16]; ··· 429 457 430 458 static void wmi_dump_wdg(const struct guid_block *g) 431 459 { 432 - char guid_string[37]; 433 - 434 - wmi_gtoa(g->guid, guid_string); 435 - 436 - pr_info("%s:\n", guid_string); 460 + pr_info("%pUL:\n", g->guid); 437 461 pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]); 438 462 pr_info("\tnotify_id: %02X\n", g->notify_id); 439 463 pr_info("\treserved: %02X\n", g->reserved); ··· 629 661 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, 630 662 char *buf) 631 663 { 632 - char guid_string[37]; 633 664 struct wmi_block *wblock; 634 665 635 666 wblock = dev_get_drvdata(dev); ··· 637 670 return strlen(buf); 638 671 } 639 672 640 - wmi_gtoa(wblock->gblock.guid, guid_string); 641 - 642 - return sprintf(buf, "wmi:%s\n", guid_string); 673 + return sprintf(buf, "wmi:%pUL\n", wblock->gblock.guid); 643 674 } 644 675 static DEVICE_ATTR_RO(modalias); 645 676 ··· 660 695 if (!wblock) 661 696 return -ENOMEM; 662 697 663 - wmi_gtoa(wblock->gblock.guid, guid_string); 698 + sprintf(guid_string, "%pUL", wblock->gblock.guid); 664 699 665 700 strcpy(&env->buf[env->buflen - 1], "wmi:"); 666 701 memcpy(&env->buf[env->buflen - 1 + 4], guid_string, 36); ··· 686 721 static int wmi_create_device(const struct guid_block *gblock, 687 722 struct wmi_block *wblock, acpi_handle handle) 688 723 { 689 - char guid_string[37]; 690 - 691 724 wblock->dev.class = &wmi_class; 692 725 693 - wmi_gtoa(gblock->guid, guid_string); 694 - dev_set_name(&wblock->dev, "%s", guid_string); 726 + dev_set_name(&wblock->dev, "%pUL", gblock->guid); 695 727 696 728 dev_set_drvdata(&wblock->dev, wblock); 697 729 ··· 839 877 struct guid_block *block; 840 878 struct wmi_block *wblock; 841 879 struct list_head *p; 842 - char guid_string[37]; 843 880 844 881 list_for_each(p, &wmi_block_list) { 845 882 wblock = list_entry(p, struct wmi_block, list); ··· 849 888 if (wblock->handler) 850 889 wblock->handler(event, wblock->handler_data); 851 890 if (debug_event) { 852 - wmi_gtoa(wblock->gblock.guid, guid_string); 853 - pr_info("DEBUG Event GUID: %s\n", guid_string); 891 + pr_info("DEBUG Event GUID: %pUL\n", 892 + wblock->gblock.guid); 854 893 } 855 894 856 895 acpi_bus_generate_netlink_event(