Input: soc_button_array - add support for INT33D3 tablet-mode switch devices
authorHans de Goede <hdegoede@redhat.com>
Mon, 14 Sep 2020 06:05:19 +0000 (23:05 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 14 Sep 2020 06:08:47 +0000 (23:08 -0700)
commit4e5d9c198349233b2ba9eb41597a8fc9a662d608
tree4730145ae39bfc57d42b630c2bfadb9a3258befe
parent838fc8083b6241c50b0be105b47006b3ae9c9ed8
Input: soc_button_array - add support for INT33D3 tablet-mode switch devices

According to the Microsoft documentation for Windows 8 convertible
devices, these devices should implement a PNP0C60 "laptop/slate mode state
indicator" ACPI device.

This device can work in 2 ways, if there is a GPIO which directly
indicates the device is in tablet-mode or not then the direct-gpio mode
should be used. If there is no such GPIO, but instead the events are
coming from e.g. the embedded-controller, then there should still be
a PNP0C60 ACPI device and event-injection should be used to send the
events. The drivers/platform/x86/intel-vbtn.c code is an example from
a standardized manner of doing the latter.

On various 2-in-1s with either a detachable keyboard, or with 360°
hinges, the direct GPIO mode is indicated by an ACPI device with a
HID of INT33D3, which contains a single GpioInt in its ACPI resource
table, which directly indicates if the device is in tablet-mode or not.

This commit adds support for this to the soc_button_array code, as
well as for the alternative ID9001 HID which some devices use
instead of the INT33D3 HID.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200826150601.12137-3-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/soc_button_array.c