diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-06-24 14:23:38 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-06-28 22:45:38 +0300 |
commit | 027f88453dbf34cafce1c31e93c216665cdd71d2 (patch) | |
tree | 01f5bff87cea05a3e8cea4c98b80f0416cdfde78 /drivers/platform/x86/panasonic-laptop.c | |
parent | cb1f7d49736e05862c7d7df1c97676bb42c75e5c (diff) | |
download | linux-027f88453dbf34cafce1c31e93c216665cdd71d2.tar.xz |
platform/x86: panasonic-laptop: don't report duplicate brightness key-presses
The brightness key-presses might also get reported by the ACPI video bus,
check for this and in this case don't report the presses to avoid reporting
2 presses for a single key-press.
Fixes: ed83c9171829 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug")
Reported-and-tested-by: Stefan Seyfried <seife+kernel@b1-systems.com>
Reported-and-tested-by: Kenneth Chan <kenneth.t.chan@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220624112340.10130-6-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86/panasonic-laptop.c')
-rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 2e6531dd15f9..d65e6c2372ca 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c @@ -132,6 +132,7 @@ #include <linux/slab.h> #include <linux/types.h> #include <linux/uaccess.h> +#include <acpi/video.h> MODULE_AUTHOR("Hiroshi Miura <miura@da-cha.org>"); MODULE_AUTHOR("David Bronaugh <dbronaugh@linuxboxen.org>"); @@ -783,6 +784,13 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) key, 0x80, false); } + /* + * Don't report brightness key-presses if they are also reported + * by the ACPI video bus. + */ + if ((key == 1 || key == 2) && acpi_video_handles_brightness_key_presses()) + return; + if (!sparse_keymap_report_event(hotk_input_dev, key, updown, false)) pr_err("Unknown hotkey event: 0x%04llx\n", result); } |