Skip to content

Commit 6ec37e6

Browse files
committed
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
2 parents f1e141e + 1797d58 commit 6ec37e6

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

drivers/platform/x86/asus-nb-wmi.c

+32
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ static struct quirk_entry quirk_asus_vendor_backlight = {
115115
.wmi_backlight_set_devstate = true,
116116
};
117117

118+
static struct quirk_entry quirk_asus_use_kbd_dock_devid = {
119+
.use_kbd_dock_devid = true,
120+
};
121+
118122
static int dmi_matched(const struct dmi_system_id *dmi)
119123
{
120124
pr_info("Identified laptop model '%s'\n", dmi->ident);
@@ -488,6 +492,34 @@ static const struct dmi_system_id asus_quirks[] = {
488492
},
489493
.driver_data = &quirk_asus_vendor_backlight,
490494
},
495+
{
496+
.callback = dmi_matched,
497+
.ident = "Asus Transformer T100TA / T100HA / T100CHI",
498+
.matches = {
499+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
500+
/* Match *T100* */
501+
DMI_MATCH(DMI_PRODUCT_NAME, "T100"),
502+
},
503+
.driver_data = &quirk_asus_use_kbd_dock_devid,
504+
},
505+
{
506+
.callback = dmi_matched,
507+
.ident = "Asus Transformer T101HA",
508+
.matches = {
509+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
510+
DMI_MATCH(DMI_PRODUCT_NAME, "T101HA"),
511+
},
512+
.driver_data = &quirk_asus_use_kbd_dock_devid,
513+
},
514+
{
515+
.callback = dmi_matched,
516+
.ident = "Asus Transformer T200TA",
517+
.matches = {
518+
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
519+
DMI_MATCH(DMI_PRODUCT_NAME, "T200TA"),
520+
},
521+
.driver_data = &quirk_asus_use_kbd_dock_devid,
522+
},
491523
{},
492524
};
493525

drivers/platform/x86/asus-wmi.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,14 @@ static int asus_wmi_input_init(struct asus_wmi *asus)
365365
if (err)
366366
goto err_free_dev;
367367

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+
}
374376
}
375377

376378
err = input_register_device(asus->inputdev);
@@ -2115,7 +2117,7 @@ static void asus_wmi_handle_event_code(int code, struct asus_wmi *asus)
21152117
return;
21162118
}
21172119

2118-
if (code == NOTIFY_KBD_DOCK_CHANGE) {
2120+
if (asus->driver->quirks->use_kbd_dock_devid && code == NOTIFY_KBD_DOCK_CHANGE) {
21192121
result = asus_wmi_get_devstate_simple(asus,
21202122
ASUS_WMI_DEVID_KBD_DOCK);
21212123
if (result >= 0) {

drivers/platform/x86/asus-wmi.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct quirk_entry {
3333
bool wmi_backlight_native;
3434
bool wmi_backlight_set_devstate;
3535
bool wmi_force_als_set;
36+
bool use_kbd_dock_devid;
3637
int wapf;
3738
/*
3839
* For machines with AMD graphic chips, it will send out WMI event

0 commit comments

Comments
 (0)