summaryrefslogtreecommitdiffstats
path: root/platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch
diff options
context:
space:
mode:
authorJeremy Cline <jeremy@jcline.org>2018-03-02 10:00:46 -0500
committerJeremy Cline <jeremy@jcline.org>2018-03-02 10:00:46 -0500
commit5860e766a687094612f3c37a219f248078148541 (patch)
tree4d2990288584f1cc2443e8277085a44e23455a35 /platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch
parent4b0b1380a2eee7ba70743f75bca5677c1f93b2e7 (diff)
downloadkernel-5860e766a687094612f3c37a219f248078148541.tar.gz
kernel-5860e766a687094612f3c37a219f248078148541.tar.xz
kernel-5860e766a687094612f3c37a219f248078148541.zip
Linux v4.16-rc3-245-g5d60e057d127
Diffstat (limited to 'platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch')
-rw-r--r--platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch95
1 files changed, 0 insertions, 95 deletions
diff --git a/platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch b/platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch
deleted file mode 100644
index ab9a24faa..000000000
--- a/platform-x86-Only-activate-tablet-mode-switch-on-2-i.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 7714f7a44a29a4e873d5acfd4c9549c87a4bb4e4 Mon Sep 17 00:00:00 2001
-From: Mario Limonciello <mario.limonciello@dell.com>
-Date: Thu, 22 Feb 2018 13:58:42 -0600
-Subject: [PATCH] platform/x86: Only activate tablet mode switch on 2-in-1's
-
-Some laptops such as the XPS 9360 support the intel-vbtn INT33D6
-interface but don't initialize the bit that intel-vbtn uses to
-represent switching tablet mode.
-
-By running this only on real 2-in-1's it shouldn't cause false
-positives.
-
-Fixes: 30323fb6d5 ("Support tablet mode switch")
-Reported-by: Jeremy Cline <jeremy@jcline.org>
-Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
----
- drivers/platform/x86/intel-vbtn.c | 46 ++++++++++++++++++++++++---------------
- 1 file changed, 29 insertions(+), 17 deletions(-)
-
-diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
-index b703d6f5b099..8173307d6bb1 100644
---- a/drivers/platform/x86/intel-vbtn.c
-+++ b/drivers/platform/x86/intel-vbtn.c
-@@ -7,6 +7,7 @@
- */
-
- #include <linux/acpi.h>
-+#include <linux/dmi.h>
- #include <linux/input.h>
- #include <linux/input/sparse-keymap.h>
- #include <linux/kernel.h>
-@@ -97,9 +98,35 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
- dev_dbg(&device->dev, "unknown event index 0x%x\n", event);
- }
-
--static int intel_vbtn_probe(struct platform_device *device)
-+static void detect_tablet_mode(struct platform_device *device)
- {
-+ const char *chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
-+ struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
-+ acpi_handle handle = ACPI_HANDLE(&device->dev);
- struct acpi_buffer vgbs_output = { ACPI_ALLOCATE_BUFFER, NULL };
-+ union acpi_object *obj;
-+ acpi_status status;
-+ int m;
-+
-+ if (!(chassis_type && strcmp(chassis_type, "31") == 0))
-+ goto out;
-+
-+ status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output);
-+ if (ACPI_FAILURE(status))
-+ goto out;
-+
-+ obj = vgbs_output.pointer;
-+ if (!(obj && obj->type == ACPI_TYPE_INTEGER))
-+ goto out;
-+
-+ m = !(obj->integer.value & TABLET_MODE_FLAG);
-+ input_report_switch(priv->input_dev, SW_TABLET_MODE, m);
-+out:
-+ kfree(vgbs_output.pointer);
-+}
-+
-+static int intel_vbtn_probe(struct platform_device *device)
-+{
- acpi_handle handle = ACPI_HANDLE(&device->dev);
- struct intel_vbtn_priv *priv;
- acpi_status status;
-@@ -122,22 +149,7 @@ static int intel_vbtn_probe(struct platform_device *device)
- return err;
- }
-
-- /*
-- * VGBS being present and returning something means we have
-- * a tablet mode switch.
-- */
-- status = acpi_evaluate_object(handle, "VGBS", NULL, &vgbs_output);
-- if (ACPI_SUCCESS(status)) {
-- union acpi_object *obj = vgbs_output.pointer;
--
-- if (obj && obj->type == ACPI_TYPE_INTEGER) {
-- int m = !(obj->integer.value & TABLET_MODE_FLAG);
--
-- input_report_switch(priv->input_dev, SW_TABLET_MODE, m);
-- }
-- }
--
-- kfree(vgbs_output.pointer);
-+ detect_tablet_mode(device);
-
- status = acpi_install_notify_handler(handle,
- ACPI_DEVICE_NOTIFY,
---
-2.16.2
-