summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorClément Vuchener <clement.vuchener@gmail.com>2016-02-16 20:38:24 +0300
committerJiri Kosina <jkosina@suse.cz>2016-02-23 16:21:19 +0300
commite791f7b102138e4f2bbd7ea6e968ba77c59b3764 (patch)
treede4fa05b4632bc8c2758daeddfa8e0eefce3cb9b /drivers/hid
parent4392bf333388cabdad5afe5b1500002d7b9c318e (diff)
downloadlinux-e791f7b102138e4f2bbd7ea6e968ba77c59b3764.tar.xz
HID: corsair: fix mapping of non-keyboard usages
This fixes a bug where the Volume Up key was ignored because it uses the same usage code as G18. Special Corsair usage codes are in the keyboard page, other pages should be left to the generic driver. Signed-off-by: Clément Vuchener <clement.vuchener@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-corsair.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
index 58551964ce86..717704e9ae07 100644
--- a/drivers/hid/hid-corsair.c
+++ b/drivers/hid/hid-corsair.c
@@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
{
int gkey;
+ if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
+ return 0;
+
gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
if (gkey != 0) {
hid_map_usage_clear(input, usage, bit, max, EV_KEY,