Skip to content

Commit

Permalink
ACPI: button: Add a LID switch blacklist and add 1 model to it
Browse files Browse the repository at this point in the history
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 <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
jwrdegoede authored and rafaeljw committed Dec 13, 2017
1 parent ae35d65 commit 9e811e1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/input.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <acpi/button.h>

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

/*
* Some devices which don't even have a lid in anyway have a broken _LID
* method (e.g. pointing to a floating gpio pin) causing spurious LID events.
*/
static const struct dmi_system_id lid_blacklst[] = {
{
/* GP-electronic T701 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
},
},
{}
};

static int acpi_button_add(struct acpi_device *device);
static int acpi_button_remove(struct acpi_device *device);
static void acpi_button_notify(struct acpi_device *device, u32 event);
Expand Down Expand Up @@ -475,6 +492,9 @@ static int acpi_button_add(struct acpi_device *device)
char *name, *class;
int error;

if (!strcmp(hid, ACPI_BUTTON_HID_LID) && dmi_check_system(lid_blacklst))
return -ENODEV;

button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL);
if (!button)
return -ENOMEM;
Expand Down

0 comments on commit 9e811e1

Please sign in to comment.