Skip to content

Commit 7f45621

Browse files
committed
platform/x86: asus-nb-wmi: Allow configuring SW_TABLET_MODE method with a module option
Unfortunately we have been unable to find a reliable way to detect if and how SW_TABLET_MODE reporting is supported, so we are relying on DMI quirks for this. Add a module-option to specify the SW_TABLET_MODE method so that this can be easily tested without needing to rebuild the kernel. BugLink: https://gitlab.freedesktop.org/libinput/libinput/-/issues/639 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9d7b132 commit 7f45621

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ static int wapf = -1;
4141
module_param(wapf, uint, 0444);
4242
MODULE_PARM_DESC(wapf, "WAPF value");
4343

44+
static int tablet_mode_sw = -1;
45+
module_param(tablet_mode_sw, uint, 0444);
46+
MODULE_PARM_DESC(tablet_mode_sw, "Tablet mode detect: -1:auto 0:disable 1:kbd-dock 2:lid-flip");
47+
4448
static struct quirk_entry *quirks;
4549

4650
static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
@@ -477,6 +481,21 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)
477481
else
478482
wapf = quirks->wapf;
479483

484+
switch (tablet_mode_sw) {
485+
case 0:
486+
quirks->use_kbd_dock_devid = false;
487+
quirks->use_lid_flip_devid = false;
488+
break;
489+
case 1:
490+
quirks->use_kbd_dock_devid = true;
491+
quirks->use_lid_flip_devid = false;
492+
break;
493+
case 2:
494+
quirks->use_kbd_dock_devid = false;
495+
quirks->use_lid_flip_devid = true;
496+
break;
497+
}
498+
480499
if (quirks->i8042_filter) {
481500
ret = i8042_install_filter(quirks->i8042_filter);
482501
if (ret) {

0 commit comments

Comments
 (0)