]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
platform/x86: intel-vbtn: match power button on press rather than release
authorMario Limonciello <mario.limonciello@dell.com>
Fri, 4 Aug 2017 17:00:06 +0000 (12:00 -0500)
committerDarren Hart (VMware) <dvhart@infradead.org>
Sat, 5 Aug 2017 21:37:19 +0000 (14:37 -0700)
commit946da69954485c4da51c785438f98fb13784941a
treec4ee263401c14907225082eeb766f8e287222e6b
parent51391caf99e34d2d75ffc428845062d93aa739c6
platform/x86: intel-vbtn: match power button on press rather than release

This fixes a problem where the system gets stuck in a loop
unable to wakeup via power button in s2idle.

The problem happens because:
 - press power button:
   - system emits 0xc0 (power press), event ignored
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - set wakeup_mode to true
   - system goes to s2idle
 - press power button
   - system emits 0xc0 (power press), wakeup_mode is true,
     system wakes
   - system emits 0xc1 (power release), event processed,
     emited as KEY_POWER
   - system goes to s2idle again

To avoid this situation, process the presses (which matches what
intel-hid does too).

Verified on an Dell XPS 9365

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/intel-vbtn.c