Skip to content

Commit

Permalink
platform/x86: panasonic-laptop: Resolve hotkey double trigger bug
Browse files Browse the repository at this point in the history
Sometimes double ACPI events are triggered for brightness, vol and mute
hotkeys. This patch fixes it.

Signed-off-by: Kenneth Chan <kenneth.t.chan@gmail.com>
Link: https://lore.kernel.org/r/20200821181433.17653-8-kenneth.t.chan@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Kenneth Chan authored and Hans de Goede committed Nov 10, 2020
1 parent e3a9afb commit ed83c91
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/platform/x86/panasonic-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* ChangeLog:
* Aug.18, 2020 Kenneth Chan <kenneth.t.chan@gmail.com>
* resolve hotkey double trigger
* add write support to mute
* fix sticky_key init bug
* fix naming of platform files for consistency with other
Expand Down Expand Up @@ -597,9 +598,11 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
result & 0xf, 0x80, false);
}

if (!sparse_keymap_report_event(hotk_input_dev,
result & 0xf, result & 0x80, false))
pr_err("Unknown hotkey event: 0x%04llx\n", result);
if ((result & 0xf) == 0x7 || (result & 0xf) == 0x9 || (result & 0xf) == 0xa) {
if (!sparse_keymap_report_event(hotk_input_dev,
result & 0xf, result & 0x80, false))
pr_err("Unknown hotkey event: 0x%04llx\n", result);
}
}

static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event)
Expand Down

0 comments on commit ed83c91

Please sign in to comment.