HID: apple: Fix stuck function keys when using FN
authorJoao Moreno <mail@joaomoreno.com>
Tue, 3 Sep 2019 14:46:32 +0000 (16:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:57:12 +0000 (18:57 +0200)
commit709c4841e51f21e9171916b590bf25aa1e3a8997
tree843e4e6d667684fce7d0684458f4a0bba0db600d
parent31e98cba55edc3986a1094df401074d01d5e064f
HID: apple: Fix stuck function keys when using FN

[ Upstream commit aec256d0ecd561036f188dbc8fa7924c47a9edfd ]

This fixes an issue in which key down events for function keys would be
repeatedly emitted even after the user has raised the physical key. For
example, the driver fails to emit the F5 key up event when going through
the following steps:
- fnmode=1: hold FN, hold F5, release FN, release F5
- fnmode=2: hold F5, hold FN, release F5, release FN

The repeated F5 key down events can be easily verified using xev.

Signed-off-by: Joao Moreno <mail@joaomoreno.com>
Co-developed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-apple.c