Suggested by Daniel Martin
Lenovo's having a bit of fun randomly changing what hotkey events and
acpi handles they use for reporting tablet mode, so unfortunately this
means we're definitely going to need to probe for multiple types of
tablet mode support. Since the hotkey_init() is already a lot
Updated patchset for adding support for detecting tablet mode on the X1 Yoga
2016 model, along with some refactoring suggested by Daniel.
Important: I realized I never actually tried testing this on any of the older
Thinkpad tablets. If someone has one who is willing to test let me know,
otherwise
For whatever reason, the X1 Yoga doesn't support the normal method of
querying for tablet mode. Instead of providing the MHKG method under the
hotkey handle, we're instead given the CMMD method under the EC handle.
Values on this handle are either 0x1, laptop mode, or 0x6, tablet mode.
Changes sin
There's no need to have multiple copies of the logic we use for checking
whether or not we're in tablet mode, so just use
hotkey_get_tablet_mode() when checking the initial state in
hotkey_init_tablet_mode().
Cc: Daniel Martin
Signed-off-by: Lyude
---
drivers/platform/x86/thinkpad_acpi.c | 5 ++
Suggested by Daniel Martin
Lenovo's having a bit of fun randomly changing what hotkey events and
acpi handles they use for reporting tablet mode, so unfortunately this
means we're definitely going to need to probe for multiple types of
tablet mode support. Since the hotkey_init() is already a lot