aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-core.c
diff options
context:
space:
mode:
authorSean O'Brien <seobrien@chromium.org>2020-09-09 15:03:04 -0700
committerJiri Kosina <jkosina@suse.cz>2020-09-30 22:44:26 +0200
commit14c9c014babedc6098bf4cd83c622997867bc0df (patch)
tree46971e93b820a8f56783e09bfea4beb1ab2a9018 /drivers/hid/hid-core.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid (diff)
downloadlinux-dev-14c9c014babedc6098bf4cd83c622997867bc0df.tar.xz
linux-dev-14c9c014babedc6098bf4cd83c622997867bc0df.zip
HID: add vivaldi HID driver
Add vivaldi HID driver. This driver allows us to read and report the top row layout of keyboards which provide a vendor-defined (Google) HID usage. Signed-off-by: Sean O'Brien <seobrien@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r--drivers/hid/hid-core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index d2ecc9c45255..6dbd09254c44 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -814,6 +814,13 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
if ((parser->global.usage_page << 16) >= HID_UP_MSVENDOR)
parser->scan_flags |= HID_SCAN_FLAG_VENDOR_SPECIFIC;
+
+ if ((parser->global.usage_page << 16) == HID_UP_GOOGLEVENDOR)
+ for (i = 0; i < parser->local.usage_index; i++)
+ if (parser->local.usage[i] ==
+ (HID_UP_GOOGLEVENDOR | 0x0001))
+ parser->device->group =
+ HID_GROUP_VIVALDI;
}
static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)