]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: hp-wmi: Fix detection for dock and tablet mode
authorCarlo Caione <carlo@endlessm.com>
Sun, 9 Apr 2017 13:56:08 +0000 (15:56 +0200)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 14 Apr 2017 15:26:35 +0000 (08:26 -0700)
commitb24f67326dffa0ee8cab1e860a5a042a95e12f78
tree133a35cbdd7a010f3bfcf4ecf9f22fc921778ade
parent6e83464e5d235440cc1b03e1366b4f7bd974ac6b
platform/x86: hp-wmi: Fix detection for dock and tablet mode

The current driver code is not checking for the error values returned by
'hp_wmi_dock_state()' and 'hp_wmi_tablet_state()' before passing the
returned values down to 'input_report_switch()'. This error code is
being translated to '1' in the input subsystem, reporting the wrong
status.

The biggest problem caused by this issue is that several laptops are
wrongly reported by the driver as docked, preventing them to be put to
sleep using the LID (and in most cases they are not even dockable).

With this patch we create the report switches only if we are able to
read the dock and tablet mode status correctly from ACPI.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/hp-wmi.c