aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-11-22 10:06:12 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-12-12 19:05:02 -0500
commit9e811e19a7aca16d40e1ce0c68e9bbffea1b9810 (patch)
treeba75435905dfc3d6c5e517a980136fb38f4e211c
parentae35d656d796fa203787455ce59874c6682dc0cf (diff)
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 <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/button.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index aac81f40e28e..e1eee7a60fad 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -30,6 +30,7 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/acpi.h> 32#include <linux/acpi.h>
33#include <linux/dmi.h>
33#include <acpi/button.h> 34#include <acpi/button.h>
34 35
35#define PREFIX "ACPI: " 36#define PREFIX "ACPI: "
@@ -76,6 +77,22 @@ static const struct acpi_device_id button_device_ids[] = {
76}; 77};
77MODULE_DEVICE_TABLE(acpi, button_device_ids); 78MODULE_DEVICE_TABLE(acpi, button_device_ids);
78 79
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 */
84static 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
79static int acpi_button_add(struct acpi_device *device); 96static int acpi_button_add(struct acpi_device *device);
80static int acpi_button_remove(struct acpi_device *device); 97static int acpi_button_remove(struct acpi_device *device);
81static void acpi_button_notify(struct acpi_device *device, u32 event); 98static void acpi_button_notify(struct acpi_device *device, u32 event);
@@ -475,6 +492,9 @@ static int acpi_button_add(struct acpi_device *device)
475 char *name, *class; 492 char *name, *class;
476 int error; 493 int error;
477 494
495 if (!strcmp(hid, ACPI_BUTTON_HID_LID) && dmi_check_system(lid_blacklst))
496 return -ENODEV;
497
478 button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL); 498 button = kzalloc(sizeof(struct acpi_button), GFP_KERNEL);
479 if (!button) 499 if (!button)
480 return -ENOMEM; 500 return -ENOMEM;