OSDN Git Service

platform/x86: thinkpad_acpi: Move tablet detection into separate function
authorLyude <lyude@redhat.com>
Fri, 11 Nov 2016 20:15:02 +0000 (15:15 -0500)
committerDarren Hart <dvhart@linux.intel.com>
Tue, 13 Dec 2016 17:29:05 +0000 (09:29 -0800)
commitb31800283868746fc59686486a11fb24b103955b
treedc7ee209d4b5929e8ed57ce6a73f8f6289bbd495
parente74e259939275a5dd4e0d02845c694f421e249ad
platform/x86: thinkpad_acpi: Move tablet detection into separate function

The hotkey events and ACPI handles used for detecting tablet mode on a
few of the newer thinkpad models (Yoga X1 and the Yoga 260 specifically)
have been changed around, 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 larger than it should be, let's split
up this detection into its own function to make things a little easier
to read.

As well, since we're going to have multiple types of tablet modes, make
hotkey_tablet into an enum so we can also use it to indicate the type of
tablet mode reporting the machine supports.

Suggested by Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Lyude <lyude@redhat.com>
Cc: Daniel Martin <consume.noise@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c