Skip to content

Commit 1f2c9de

Browse files
committed
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: ed83c91 ("platform/x86: panasonic-laptop: Resolve hotkey double trigger bug") Reported-and-tested-by: Stefan Seyfried <[email protected]> Reported-and-tested-by: Kenneth Chan <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 83a5ddc commit 1f2c9de

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ config PANASONIC_LAPTOP
945945
tristate "Panasonic Laptop Extras"
946946
depends on INPUT && ACPI
947947
depends on BACKLIGHT_CLASS_DEVICE
948+
depends on ACPI_VIDEO=n || ACPI_VIDEO
948949
select INPUT_SPARSEKMAP
949950
help
950951
This driver adds support for access to backlight control and hotkeys

drivers/platform/x86/panasonic-laptop.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
#include <linux/slab.h>
133133
#include <linux/types.h>
134134
#include <linux/uaccess.h>
135+
#include <acpi/video.h>
135136

136137
MODULE_AUTHOR("Hiroshi Miura <[email protected]>");
137138
MODULE_AUTHOR("David Bronaugh <[email protected]>");
@@ -783,6 +784,13 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
783784
key, 0x80, false);
784785
}
785786

787+
/*
788+
* Don't report brightness key-presses if they are also reported
789+
* by the ACPI video bus.
790+
*/
791+
if ((key == 1 || key == 2) && acpi_video_handles_brightness_key_presses())
792+
return;
793+
786794
if (!sparse_keymap_report_event(hotk_input_dev, key, updown, false))
787795
pr_err("Unknown hotkey event: 0x%04llx\n", result);
788796
}

0 commit comments

Comments
 (0)