Skip to content

Commit 946da69

Browse files
Mario Limonciellodvhart
authored andcommitted
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>
1 parent 51391ca commit 946da69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/x86/intel-vbtn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ static const struct acpi_device_id intel_vbtn_ids[] = {
3636

3737
/* In theory, these are HID usages. */
3838
static const struct key_entry intel_vbtn_keymap[] = {
39-
{ KE_IGNORE, 0xC0, { KEY_POWER } }, /* power key press */
40-
{ KE_KEY, 0xC1, { KEY_POWER } }, /* power key release */
39+
{ KE_KEY, 0xC0, { KEY_POWER } }, /* power key press */
40+
{ KE_IGNORE, 0xC1, { KEY_POWER } }, /* power key release */
4141
{ KE_KEY, 0xC4, { KEY_VOLUMEUP } }, /* volume-up key press */
4242
{ KE_IGNORE, 0xC5, { KEY_VOLUMEUP } }, /* volume-up key release */
4343
{ KE_KEY, 0xC6, { KEY_VOLUMEDOWN } }, /* volume-down key press */

0 commit comments

Comments
 (0)