mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-15 22:41:38 +00:00
HID: lenovo: Map mic-mute button to KEY_F20 instead of KEY_MICMUTE
[ Upstream commit617103246c] Mapping the mic-mute button to KEY_MICMUTE is technically correct but KEY_MICMUTE translates to a scancode of 256 (248 + 8) under X, which does not fit in 8 bits, so it does not work. Because of this userspace is expecting KEY_F20 instead, theoretically KEY_MICMUTE should work under Wayland but even there it does not work, because the desktop-environment is listening only for KEY_F20 and not for KEY_MICMUTE. Fixes:bc04b37ea0("HID: lenovo: Add ThinkPad 10 Ultrabook Keyboard support") Reviewed-by: Marek Behún <kabel@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9b14027e4c
commit
348f68ae40
@@ -33,6 +33,9 @@
|
|||||||
|
|
||||||
#include "hid-ids.h"
|
#include "hid-ids.h"
|
||||||
|
|
||||||
|
/* Userspace expects F20 for mic-mute KEY_MICMUTE does not work */
|
||||||
|
#define LENOVO_KEY_MICMUTE KEY_F20
|
||||||
|
|
||||||
struct lenovo_drvdata {
|
struct lenovo_drvdata {
|
||||||
u8 led_report[3]; /* Must be first for proper alignment */
|
u8 led_report[3]; /* Must be first for proper alignment */
|
||||||
int led_state;
|
int led_state;
|
||||||
@@ -134,7 +137,7 @@ static int lenovo_input_mapping_tpkbd(struct hid_device *hdev,
|
|||||||
if (usage->hid == (HID_UP_BUTTON | 0x0010)) {
|
if (usage->hid == (HID_UP_BUTTON | 0x0010)) {
|
||||||
/* This sub-device contains trackpoint, mark it */
|
/* This sub-device contains trackpoint, mark it */
|
||||||
hid_set_drvdata(hdev, (void *)1);
|
hid_set_drvdata(hdev, (void *)1);
|
||||||
map_key_clear(KEY_MICMUTE);
|
map_key_clear(LENOVO_KEY_MICMUTE);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -149,7 +152,7 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
|
|||||||
(usage->hid & HID_USAGE_PAGE) == HID_UP_LNVENDOR) {
|
(usage->hid & HID_USAGE_PAGE) == HID_UP_LNVENDOR) {
|
||||||
switch (usage->hid & HID_USAGE) {
|
switch (usage->hid & HID_USAGE) {
|
||||||
case 0x00f1: /* Fn-F4: Mic mute */
|
case 0x00f1: /* Fn-F4: Mic mute */
|
||||||
map_key_clear(KEY_MICMUTE);
|
map_key_clear(LENOVO_KEY_MICMUTE);
|
||||||
return 1;
|
return 1;
|
||||||
case 0x00f2: /* Fn-F5: Brightness down */
|
case 0x00f2: /* Fn-F5: Brightness down */
|
||||||
map_key_clear(KEY_BRIGHTNESSDOWN);
|
map_key_clear(KEY_BRIGHTNESSDOWN);
|
||||||
@@ -239,7 +242,7 @@ static int lenovo_input_mapping_tp10_ultrabook_kbd(struct hid_device *hdev,
|
|||||||
map_key_clear(KEY_FN_ESC);
|
map_key_clear(KEY_FN_ESC);
|
||||||
return 1;
|
return 1;
|
||||||
case 9: /* Fn-F4: Mic mute */
|
case 9: /* Fn-F4: Mic mute */
|
||||||
map_key_clear(KEY_MICMUTE);
|
map_key_clear(LENOVO_KEY_MICMUTE);
|
||||||
return 1;
|
return 1;
|
||||||
case 10: /* Fn-F7: Control panel */
|
case 10: /* Fn-F7: Control panel */
|
||||||
map_key_clear(KEY_CONFIG);
|
map_key_clear(KEY_CONFIG);
|
||||||
|
|||||||
Reference in New Issue
Block a user