Skip to content

Commit d823346

Browse files
jwrdegoedeandy-shev
authored andcommitted
platform/x86: intel-vbtn: Fix SW_TABLET_MODE always reporting 1 on the HP Pavilion 11 x360
Commit cfae58e ("platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type") restored SW_TABLET_MODE reporting on the HP stream x360 11 series on which it was previously broken by commit de9647e ("platform/x86: intel-vbtn: Only activate tablet mode switch on 2-in-1's"). It turns out that enabling SW_TABLET_MODE reporting on devices with a chassis-type of 10 ("Notebook") causes SW_TABLET_MODE to always report 1 at boot on the HP Pavilion 11 x360, which causes libinput to disable the kbd and touchpad. The HP Pavilion 11 x360's ACPI VGBS method sets bit 4 instead of bit 6 when NOT in tablet mode at boot. Inspecting all the DSDTs in my DSDT collection shows only one other model, the Medion E1239T ever setting bit 4 and it always sets this together with bit 6. So lets treat bit 4 as a second bit which when set indicates the device not being in tablet-mode, as we already do for bit 6. While at it also prefix all VGBS constant defines with "VGBS_". Fixes: cfae58e ("platform/x86: intel-vbtn: Only blacklist SW_TABLET_MODE on the 9 / "Laptop" chasis-type") Signed-off-by: Hans de Goede <[email protected]> Acked-by: Mark Gross <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 1d2dd37 commit d823346

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/platform/x86/intel-vbtn.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
#include <linux/platform_device.h>
1616
#include <linux/suspend.h>
1717

18+
/* Returned when NOT in tablet mode on some HP Stream x360 11 models */
19+
#define VGBS_TABLET_MODE_FLAG_ALT 0x10
1820
/* When NOT in tablet mode, VGBS returns with the flag 0x40 */
19-
#define TABLET_MODE_FLAG 0x40
20-
#define DOCK_MODE_FLAG 0x80
21+
#define VGBS_TABLET_MODE_FLAG 0x40
22+
#define VGBS_DOCK_MODE_FLAG 0x80
23+
24+
#define VGBS_TABLET_MODE_FLAGS (VGBS_TABLET_MODE_FLAG | VGBS_TABLET_MODE_FLAG_ALT)
2125

2226
MODULE_LICENSE("GPL");
2327
MODULE_AUTHOR("AceLan Kao");
@@ -72,9 +76,9 @@ static void detect_tablet_mode(struct platform_device *device)
7276
if (ACPI_FAILURE(status))
7377
return;
7478

75-
m = !(vgbs & TABLET_MODE_FLAG);
79+
m = !(vgbs & VGBS_TABLET_MODE_FLAGS);
7680
input_report_switch(priv->input_dev, SW_TABLET_MODE, m);
77-
m = (vgbs & DOCK_MODE_FLAG) ? 1 : 0;
81+
m = (vgbs & VGBS_DOCK_MODE_FLAG) ? 1 : 0;
7882
input_report_switch(priv->input_dev, SW_DOCK, m);
7983
}
8084

0 commit comments

Comments
 (0)