]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: Add custom surface3 platform device for controlling LID
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 25 Nov 2016 16:11:41 +0000 (17:11 +0100)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 16 Dec 2016 21:30:25 +0000 (23:30 +0200)
commitdc5ec9a3dbef02aa241b12e1dca783a9fba97d4b
treeb8cbcf8ad12078d58b98229ae303664d36d4dfe4
parent3629c4d4f7b2a4b5bd8abd4975a4104f8a0ec62c
platform/x86: Add custom surface3 platform device for controlling LID

The LID state provided by ACPI on the Surface 3 is not accurate.
The ACPI node doesn't get notified on LID open, which means the
LID input switch stays close most of the time.

Fortunatelly, there is a WMI method which directly queries the
GPIO underneath the LID state, so it's far more reliable than ACPI.
To get the notifications that the LID was opened/closed, we can
rely on the ACPI notification of the touchscreen: the DSDT shows
that the touchscreen will get notified on close/open as it also
controls its _STA method.

Note that we need to set the tag "power-switch" to the LID
input node through a udev rule for logind to accept it:

SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="surface3-wmi", \
TAG+="power-switch"

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/Kconfig
drivers/platform/x86/Makefile
drivers/platform/x86/surface3-wmi.c [new file with mode: 0644]