Merge tag 'platform-drivers-x86-v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull another x86 platform driver fix from Hans de Goede:
"One final pdx86 fix for Tablet Mode reporting regressions (which make
the keyboard and touchpad unusable) on various Asus notebooks.

These regressions were caused by the asus-nb-wmi and the intel-vbtn
drivers both receiving recent patches to start reporting Tablet Mode /
to report it on more models.

Due to a miscommunication between Andy and me, Andy's earlier pull-req
only contained the fix for the intel-vbtn driver and not the fix for
the asus-nb-wmi code.

This fix has been tested as a downstream patch in Fedora kernels for
approx two weeks with no problems being reported"

* tag 'platform-drivers-x86-v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86: asus-wmi: Fix SW_TABLET_MODE always reporting 1 on many different models

Changed files
+42 -7
drivers
+32
drivers/platform/x86/asus-nb-wmi.c
··· 115 115 .wmi_backlight_set_devstate = true, 116 116 }; 117 117 118 + static struct quirk_entry quirk_asus_use_kbd_dock_devid = { 119 + .use_kbd_dock_devid = true, 120 + }; 121 + 118 122 static int dmi_matched(const struct dmi_system_id *dmi) 119 123 { 120 124 pr_info("Identified laptop model '%s'\n", dmi->ident); ··· 491 487 DMI_MATCH(DMI_PRODUCT_NAME, "GA502IV"), 492 488 }, 493 489 .driver_data = &quirk_asus_vendor_backlight, 490 + }, 491 + { 492 + .callback = dmi_matched, 493 + .ident = "Asus Transformer T100TA / T100HA / T100CHI", 494 + .matches = { 495 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 496 + /* Match *T100* */ 497 + DMI_MATCH(DMI_PRODUCT_NAME, "T100"), 498 + }, 499 + .driver_data = &quirk_asus_use_kbd_dock_devid, 500 + }, 501 + { 502 + .callback = dmi_matched, 503 + .ident = "Asus Transformer T101HA", 504 + .matches = { 505 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 506 + DMI_MATCH(DMI_PRODUCT_NAME, "T101HA"), 507 + }, 508 + .driver_data = &quirk_asus_use_kbd_dock_devid, 509 + }, 510 + { 511 + .callback = dmi_matched, 512 + .ident = "Asus Transformer T200TA", 513 + .matches = { 514 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 515 + DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"), 516 + }, 517 + .driver_data = &quirk_asus_use_kbd_dock_devid, 494 518 }, 495 519 {}, 496 520 };
+9 -7
drivers/platform/x86/asus-wmi.c
··· 365 365 if (err) 366 366 goto err_free_dev; 367 367 368 - result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_KBD_DOCK); 369 - if (result >= 0) { 370 - input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); 371 - input_report_switch(asus->inputdev, SW_TABLET_MODE, !result); 372 - } else if (result != -ENODEV) { 373 - pr_err("Error checking for keyboard-dock: %d\n", result); 368 + if (asus->driver->quirks->use_kbd_dock_devid) { 369 + result = asus_wmi_get_devstate_simple(asus, ASUS_WMI_DEVID_KBD_DOCK); 370 + if (result >= 0) { 371 + input_set_capability(asus->inputdev, EV_SW, SW_TABLET_MODE); 372 + input_report_switch(asus->inputdev, SW_TABLET_MODE, !result); 373 + } else if (result != -ENODEV) { 374 + pr_err("Error checking for keyboard-dock: %d\n", result); 375 + } 374 376 } 375 377 376 378 err = input_register_device(asus->inputdev); ··· 2117 2115 return; 2118 2116 } 2119 2117 2120 - if (code == NOTIFY_KBD_DOCK_CHANGE) { 2118 + if (asus->driver->quirks->use_kbd_dock_devid && code == NOTIFY_KBD_DOCK_CHANGE) { 2121 2119 result = asus_wmi_get_devstate_simple(asus, 2122 2120 ASUS_WMI_DEVID_KBD_DOCK); 2123 2121 if (result >= 0) {
+1
drivers/platform/x86/asus-wmi.h
··· 33 33 bool wmi_backlight_native; 34 34 bool wmi_backlight_set_devstate; 35 35 bool wmi_force_als_set; 36 + bool use_kbd_dock_devid; 36 37 int wapf; 37 38 /* 38 39 * For machines with AMD graphic chips, it will send out WMI event