1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * HID driver for Semitek keyboards
5 * Copyright (c) 2021 Benjamin Moody
8 #include <linux/device.h>
10 #include <linux/module.h>
14 static __u8 *semitek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
17 /* In the report descriptor for interface 2, fix the incorrect
18 description of report ID 0x04 (the report contains a
19 bitmask, not an array of keycodes.) */
20 if (*rsize == 0xcb && rdesc[0x83] == 0x81 && rdesc[0x84] == 0x00) {
21 hid_info(hdev, "fixing up Semitek report descriptor\n");
27 static const struct hid_device_id semitek_devices[] = {
28 { HID_USB_DEVICE(USB_VENDOR_ID_SEMITEK, USB_DEVICE_ID_SEMITEK_KEYBOARD) },
31 MODULE_DEVICE_TABLE(hid, semitek_devices);
33 static struct hid_driver semitek_driver = {
35 .id_table = semitek_devices,
36 .report_fixup = semitek_report_fixup,
38 module_hid_driver(semitek_driver);
40 MODULE_LICENSE("GPL");