platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method
authorBenjamin Berg <bberg@redhat.com>
Fri, 15 Sep 2017 13:20:49 +0000 (15:20 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sun, 1 Oct 2017 14:33:13 +0000 (17:33 +0300)
commitdda3ec0aa631d15b12a42438d23336354037e108
tree408b55248f110694ba4e62e0c4796c0f180df539
parentcd6bf7741cf992306748db11e1888c741d16dd0f
platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method

Many thinkpad laptops and convertibles provide the GMMS method to
resolve how far the laptop has been opened and whether it has been
converted into tablet mode. This allows reporting a more precise tablet
mode state to userspace.

The current implementation only reports a summarized tablet mode state
which is triggered as soon as the input devices become unusable as they
are folded away from the display.

This will work on all models where the CMMD method was used previously and
it may also work in other cases.

Thanks to Peter Zhang of Lenovo for providing information on how to use the
GMMS method to query the tablet mode.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
Cc: Peter FP1 Zhang <zhangfp1@lenovo.com>
Cc: Lyude Paul <lyude@redhat.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c