platform/x86: intel-vbtn: Report switch events when event wakes device
authorMathew King <mathewk@chromium.org>
Mon, 20 May 2019 22:41:24 +0000 (16:41 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2019 07:53:38 +0000 (09:53 +0200)
commitf853112772b043c0e0ad10fc1734c770943b7a21
treecbd3c9e38a84f1b86444f7a4ee4203f48a12c5bd
parent2ac96173bee0ad549e9543e922a0737a077187fa
platform/x86: intel-vbtn: Report switch events when event wakes device

[ Upstream commit cb1921b17adbe6509538098ac431033378cd7165 ]

When a switch event, such as tablet mode/laptop mode or docked/undocked,
wakes a device make sure that the value of the swich is reported.
Without when a device is put in tablet mode from laptop mode when it is
suspended or vice versa the device will wake up but mode will be
incorrect.

Tested by suspending a device in laptop mode and putting it in tablet
mode, the device resumes and is in tablet mode. When suspending the
device in tablet mode and putting it in laptop mode the device resumes
and is in laptop mode.

Signed-off-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel-vbtn.c