Skip to content

Commit 9e811e1

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: button: Add a LID switch blacklist and add 1 model to it
The GP-electronic T701 tablet does not have a LID switch, but it does define a LID device in its DSDT. The _LID method points to the "\\_SB.GPO2" pin 0x18 GPIO with a pull setting of "PullDefault", which leaves the pin floating. This causes the ACPI button driver to cause spurious LID closed events, causing the device to suspend while the user is using it. There is nothing the ACPI button driver (or the gpio code) can do to fix this, so the only solution is to add a DMI based blacklist and ignore the LID device on these tablets. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ae35d65 commit 9e811e1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/acpi/button.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/input.h>
3131
#include <linux/slab.h>
3232
#include <linux/acpi.h>
33+
#include <linux/dmi.h>
3334
#include <acpi/button.h>
3435

3536
#define PREFIX "ACPI: "
@@ -76,6 +77,22 @@ static const struct acpi_device_id button_device_ids[] = {
7677
};
7778
MODULE_DEVICE_TABLE(acpi, button_device_ids);
7879

80+
/*
81+
* Some devices which don't even have a lid in anyway have a broken _LID
82+
* method (e.g. pointing to a floating gpio pin) causing spurious LID events.
83+
*/
84+
static const struct dmi_system_id lid_blacklst[] = {
85+
{
86+
/* GP-electronic T701 */
87+
.matches = {
88+
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
89+
DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
90+
DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
91+
},
92+
},
93+
{}
94+
};
95+
7996
static int acpi_button_add(struct acpi_device *device);
8097
static int acpi_button_remove(struct acpi_device *device);
8198
static void acpi_button_notify(struct acpi_device *device, u32 event);
@@ -475,6 +492,9 @@ static int acpi_button_add(struct acpi_device *device)
475492
char *name, *class;
476493
int error;
477494

495+
if (!strcmp(hid, ACPI_BUTTON_HID_LID) && dmi_check_system(lid_blacklst))
496+
return -ENODEV;
497+
478498
button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL);
479499
if (!button)
480500
return -ENOMEM;

0 commit comments

Comments
 (0)